Forum Discussion
James_78615
Nimbostratus
Apr 21, 2009Cookie persistence for certain host headers
Hi,
I have the requirement to enable cookie persistence when a user hits a particular subdomain for a site.
For example, insert a cookie and use cookie persistence for abc.site.com but any other requests for *.site.com should be load balanced without persistence.
Is this possible using the following rules?
profile persist abc_passive_cookie
defaults from cookie
mode cookie
cookie mode passive
cookie name "abc_passive_cookie"
virtual WebVS
pool WebPool
destination 1.1.1.1:http
ip protocol tcp
rules abc_persist_cookie_insert
profiles
http
tcp
persist abc_passive_cookie
rule abc_persist_cookie_insert
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] starts_with "abc.") } {
persist cookie insert abc_persist_cookie
}
}
Thanks
James
3 Replies
- The_Bhattman
Nimbostratus
Hi James,
Since you are associating a profile persistence cookie to the vip resource then you could get a way with simply doing the following:when HTTP_REQUEST { if { not ([string tolower [HTTP::host]] equals "abc.site.com") } { persist none } }
hope this helps
CB - James_78615
Nimbostratus
Thanks CB, that works great.
Is it possible to use an irule to insert a persist cookie without assigning a persistence profile to the vip? When I tried to do this I got an error when creating the irule.
Thanks
James - hoolio
Cirrostratus
No, you must have a cookie insert persistence profile added to the VIP in order to use 'persist cookie insert'.
Aaron
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