Forum Discussion
Pranav_73262
Nimbostratus
Sep 30, 2013Issue with cookie persistence
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/abcd" } {
persist cookie insert "Portal_Cookie" "0d 00:00:00"
pool Pool1
} else {
persist none
pool Pool2
}
}
=============
Above is the iRule which we are using for cookie persistence, will it insert new cookie on every request even though old cookie is present? TMOS is v 11.4.x
3 Replies
- Pranav_73262
Nimbostratus
while testing, what we are observing is even though old cookie is present, it is responding with new cookie. - StephanManthey
Nacreous
What do you want to accomplish?
Do you have a cookie persistence profile assigned already and want to add a path specific cookie now?
For testing only (!) I would recommend to turn off keepalive on your webservers and to remove the OneConnect profile on your virtual server.
With OneConnect enabled connections will be kept open and any changes to your configuration (incl. iRule) will be applied to new connections only.
Once you see stuff working as expected you should turn on the keepalive and apply the OneConnect profile of course. - What_Lies_Bene1
Cirrostratus
Yes I think it will. I think what you need to do is check for the presence of the Cookie and not insert it if it's already present or, better yet, apply the Cookie persistence via a profile, assign a default pool (2) and change your iRule to this;
when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/abcd" } { pool Pool1 } else { persist none } }
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