Forum Discussion
Chris_G_Davis_1
Nimbostratus
Dec 18, 2008JSESSIONID Persistence
I'm trying to persist off a JSESSIONID cookie generated by the WebLogic Application Server however the follow iRule isn't working.
-------------
when HTTP_REQUEST {
if { [HTTP::cookie exists "JSessionID"] } {
persist use [HTTP::cookie "JSessionID"]
-------------
Any help would be greatly appreciated.
Thanks,
Christopher G Davis
Sr. Network Engineer
SITA Atlanta Data Center
10 Replies
- James_Quinby_46Historic F5 AccountChris -
- Chris_G_Davis_1
Nimbostratus
Thanks I'll give it a go...... - Chris_G_Davis_1
Nimbostratus
See below for name references. - hoolio
Cirrostratus
Hi Chris,when HTTP_REQUEST { Log details for the request log local0. "[IP::client_addr]:[TCP::client_port]: Request to [HTTP::uri] with cookie: [HTTP::cookie value jsessionid]" Check if there is a jsessionid cookie if { [HTTP::cookie exists "jsessionid"] } { Persist off of the cookie value persist uie [HTTP::cookie "jsessionid"] Log that we're using the cookie value for persistence and the persistence key if it exists. log local0. "[IP::client_addr]:[TCP::client_port]: Used persistence record from cookie: [persist lookup uie [HTTP::cookie "jsessionid"]]" } else { Parse the jsessionid from the path (URI minus the query string) set jsess [findstr [HTTP::path] "jsessionid=" 11] Use the jsessionid from the path for persisting if { $jsess != "" } { persist uie $jsess Log that we're using the path jessionid for persistence and the persistence key if it exists. log local0. "[IP::client_addr]:[TCP::client_port]: Used persistence record from path: [persist lookup uie $jsess]" } } } when HTTP_RESPONSE { Check if there is a jsessionid cookie in the response if { [HTTP::cookie exists "jsessionid"] } { Persist off of the cookie value persist add uie [HTTP::cookie "jsessionid"] log local0. "[IP::client_addr]:[TCP::client_port]: Added persistence record from cookie: [persist lookup uie [HTTP::cookie "jsessionid"]]" } }
- Chris_G_Davis_1
Nimbostratus
That appears to have fixed it. - hoolio
Cirrostratus
Thanks for the confirmation. I updated the Codeshare example. Also, you can set the persistence timeout from the iRule and avoid the extra configuration step of adding a universal persistence profile. - hoolio
Cirrostratus
Actually, it looks like the cookie name is in all caps and the string in the URIs is all lower case. I've updated the Codeshare example with this. If you see differently in your installation, can you let me know? - Chris_G_Davis_1
Nimbostratus
Hopefully it not to late to revisit this, - hoolio
Cirrostratus
Hi Chris, - Deb_Allen_18Historic F5 AccountFWIW, there actually doesn't seem to be a default pool defined in the originally posted VS config above...
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