Forum Discussion
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"
}
}
}