Forum Discussion
Muhammad_64435
Aug 09, 2011Nimbostratus
How to clean LTM cookies
Hello,
We host multiple websites on a single domain hence single virtual server and single irule for all those websites. Consumer requests to a particular website is maintained through Cooki...
Muhammad_64435
Aug 10, 2011Nimbostratus
Thanks for checking ...
Here is some background and explanation :
Basically, I browse the first site linkID=ABC and works fine using the pool ABC. Verified in the browser cache that i got the cookie name "BIGipServerABC".
I leave the first browse open and open a second browser and start browsing the second site linkID=XYZ and got the cookie "BIGipServerXYZ.
My application works in a way that after few pages it looses the "linkID=" part in the URI then i have to rely on the Cookie .. and when I am browsing the second site XYZ and reaches to the point where i need to rely on the cookie then it breaks. It breaks because browser cache has both cookies and it send both cookies with a request and when the iRule execute the following line
set cID [findstr [HTTP::cookie names] BIGipServer 11 " " ]
it suppose to pick XYZ site cookie but instead it picks up ABC cookie and send the request to ABC pool and breaks.
Here is full code
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "http request uri -> $uri "
Catch 1: for capturing cIDs from query like URI e.g. "/shopperDisplay?linkID=ABC&shopperstatus=null" or similar situation
will catch ABC here
set cID [URI::query $uri "linkID"]
log local0. "http request cID -> $cID "
if { $cID == "" } {
if { $cID == "" } {
log local0. "extract the cID from COOKIE now "
will catch ABC again here
set cID [findstr [HTTP::cookie names] BIGipServer 11 " " ]
Catch 3: even Cookie doesn't exists -- BAD request
if { $cID == "" } {
log local0. "BAD REQUEST -- redirect to sorry page"
HTTP::redirect "http://sorry.domain.com/bigip/sorry.html?[HTTP::host][HTTP::uri]"
}
}
}
pool $cID
}
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