Forum Discussion
mpfeifer_63884
Nimbostratus
Nov 30, 2009cookie expire
Hi.
We'd like to change the expiration date of a Cookie when a client comes in with a certain Useragent-string.
Normally our users just get the default Cookie which expires after the session. ...
hoolio
Cirrostratus
Dec 04, 2009I would have expected this rule to work for you:
when LB_SELECTED {
if {[IP::addr [LB::server addr] equals 10.1.110.105] } {
persist cookie insert Cookie_Test 18144000
}
}
I tried testing on 9.3.1 and 10.0.1, but couldn't set the cookie timeout from an iRule. You might try opening a case with F5 Support on this.
As a workaround, you could try something like this:
when HTTP_RESPONSE {
log local0. "[IP::client_addr]:[TCP::client_port]: Set-Cookie: [HTTP::header values Set-Cookie]"
if {[HTTP::cookie exists $my_persist_cookie] && [IP::server_addr]:[TCP::server_port] eq "10.1.110.105:80"}{
HTTP::cookie expires $my_persist_cookie 86400
}
log local0. "[IP::client_addr]:[TCP::client_port]: Set-Cookie: [HTTP::header values Set-Cookie]"
}
Aaron
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
