Forum Discussion
Terje_Gravvold
Mar 29, 2012Nimbostratus
HTTP::cookie - How can I handle cookies with duplicate names but diffrent domain value?
I'm trying to set HttpOnly value for a given cookie name/domain combination (BigIP v9.4). The backend servers (OpenSSO) creates a authentication cookie that does not have this value set.
My ...
Terje_Gravvold
Apr 03, 2012Nimbostratus
Nice, thanks! My solution is a bit more complex :). I will test your logic later.
This also seems to work:
when HTTP_RESPONSE {
set CookieCounter 0
foreach SetCookieHeader [HTTP::header values Set-Cookie] {
incr CookieCounter
log local0. "Saving Set-Cookie header value in array, index number = $CookieCounter, Value = $SetCookieHeader"
set CookieArray("$CookieCounter") "$SetCookieHeader"
}
HTTP::header remove "Set-Cookie"
log local0. "Removing Set-Cookie HTTP headers"
foreach {Index Cookie} [array get CookieArray] {
if { $Cookie contains "iPlanetDirectoryPro" } {
HTTP::header insert "$Cookie; HttpOnly"
log local0. "Inserting cookie - $Cookie; HttpOnly"
}
else {
HTTP::header insert "$Cookie"
log local0. "Inserting cookie - $Cookie"
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects