Forum Discussion
REWRITE PROFILE SET-COOKIE ERROR
Good day ,
Kindly assist with the following :
I want to replace the path in the cookie returned from the server so that it can match what is defined in the Rewrite Profile for translation. Will the following iRule be efficient?
when HTTP_RESPONSE {
set Cookies [HTTP::cookie names]
foreach mycookie $Cookies {
if {[HTTP::cookie path $mycookie] eq “/Internet”}{
set ckval [HTTP::cookie value $mycookie]
set ckdomain [HTTP::cookie domain $mycookie]
set ckpath [string map -nocase {"/Internet" "/Internet/"} [HTTP::cookie path $mycookie]]
HTTP::cookie remove $mycookie
HTTP::cookie insert name $mycookie value $ckval domain $ckdomain path $ckpath
}elseif{[HTTP::cookie path $mycookie] eq “/Mobile”}{
set ckval [HTTP::cookie value $mycookie]
set ckdomain [HTTP::cookie domain $mycookie]
set ckpath [string map -nocase {"/Mobile" "/ Mobile/"} [HTTP::cookie path $mycookie]]
HTTP::cookie remove $mycookie
HTTP::cookie insert name $mycookie value $ckval domain $ckdomain path $ckpath
}
Thank you in advance.
Regards.
Recent Discussions
Related Content
* 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