Forum Discussion
Pedro_Gonzalez_
Nimbostratus
Nov 17, 2006Persistence with Subdomains
We have been using standard cookie persistence with our www.mycompany.com domain and it has worked fine.
Our new redesign web site is using subdomains for product categories like apparel.mycompany.com, shoes.mycompany.com and now persistence is lost.
F5 tech support suggested we write an iRule to keep a customers session on the same server with the www.mycompany.com but I'm new to iRules and don't have a clue where to start.
I've seen some examples here but nothing like what we need.
Does anyone have any ideas?
Thanks.
Pedro
- hoolio
Cirrostratus
Hi Pedro,when HTTP_RESPONSE { if {[HTTP::cookie count] > 0 } { foreach aCookie [HTTP::cookie names] { if { $aCookie == "my_persistence_cookie" } { HTTP::cookie domain $aCookie mycompany.com } } } }
- Pedro_Gonzalez_
Nimbostratus
Aaron, - hoolio
Cirrostratus
That sounds right for the default cookie name. Are you able to test this? - Pedro_Gonzalez_
Nimbostratus
I have the iRule setup but I'm waiting for development to setup the correct web site for testing. I'll let you know how I make out. Thanks. - Pedro_Gonzalez_
Nimbostratus
I tried the following iRule and going from www.company.com to apparel.company.com the BigIP sent me to a different server. - hoolio
Cirrostratus
If you're using cookie insert persistence, the cookie name should start with BIGipServer, but also contain the pool name (Click here).when HTTP_RESPONSE { if {[HTTP::cookie count] > 0 } { foreach aCookie [HTTP::cookie names] { log local0. "Cookie name: $aCookie" if { $aCookie == "BIGipServer" } { HTTP::cookie domain $aCookie company.com } } } }
- Pedro_Gonzalez_
Nimbostratus
Aaron, - zafer
Nimbostratus
Hello - hoolio
Cirrostratus
Hi Zafer, - zafer
Nimbostratus
Hi 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