Forum Discussion
Robert_47833
Altostratus
Apr 21, 2011question in http::cookie secure
when HTTP_RESPONSE
{
set myValues [HTTP::cookie names]
foreach mycookie $myValues
{
if {$mycookie == "cjj_INFO"}
{
Do nothing.
}
if {$mycookie == "cjj_SESS"}
{
Do nothing.
}
else {
HTTP::cookie secure $mycookie enable
}
}
}
If there is a http response include cjj_INFO and other cookie like,cjj_test,will they be set secure flag with respect to this irule
Because I don't know if I didn't set action or statement ,what will happen to the traffic?
Can some one help me?
Thanks very much
- nitass
Employee
>I didn't set action or statement ,what will happen to the traffic?when HTTP_RESPONSE { foreach myCookie [HTTP::cookie names] { if {not ($myCookie equals "cjj_INFO" or $myCookie equals "cjj_SESS")} { HTTP::cookie secure $myCookie enable } } }
- naladar_65658
Altostratus
Hello jucao,when HTTP_RESPONSE { set mycookienames [HTTP::cookie names] foreach cookie $mycookienames if !{ $mycookienames contains "cjj_INFO" or "cjj_SESS" } { HTTP::cookie secure $mycookienames enable } }
- Robert_47833
Altostratus
oh,thanks nitass ,naladar - nitass
Employee
>the cjj_info will be set a secure flag in the second if statement,right? - hoolio
Cirrostratus
I think it would be simpler to use a switch on the cookie value:when HTTP_RESPONSE { foreach mycookie [HTTP::cookie names] { switch $mycookie { "cjj_INFO" - "cjj_SESS" { Do nothing. } default { HTTP::cookie secure $mycookie enable } } } }
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