Forum Discussion
jaiAdityaSingla
Nimbostratus
Jan 28, 2016Check the VS port to determine if connection is SSL or not, help me to fix it
when CLIENT_ACCEPTED {
Check the VS port to determine if connection is SSL or not
switch [TCP::local_port] {
"443" {
set proto "https"
}
default {
set proto "http"
...
Kai_Wilke
MVP
Jan 29, 2016Hi 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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