Forum Discussion
Kai_Wilke
Jan 29, 2016MVP
Hi jaiAdityaSingla,
I would change the code to...
when CLIENT_ACCEPTED {
Check the VS port to determine if connection is SSL or not
if { [TCP::local_port] eq "443" } then {
set secure_cookie "; Secure"
} else {
set secure_cookie ""
}
}
when HTTP_RESPONSE {
foreach temp(cookie) [HTTP::cookie names] {
Rewrite Cookies to ensure the version is Cookie version is correct
set temp(cookie_value) [HTTP::cookie $cookie]
HTTP::cookie remove $cookie
HTTP::header insert Set-Cookie "$temp(cookie)=\"$temp(cookie_value)\"; Version=1; HttpOnly$secure_cookie; Path=/"
}
}
Note1: The code would insert a raw Set-Cookie header, with precomputed cookie options.
Note2: The "; Secure" option is getting substituted using the results of the CLIENT_ACCEPTED event.
Cheers, Kai