Forum Discussion
David_Landry
Jan 24, 2012Nimbostratus
Need help with writing an iRule to remove jsession URI content
I've got a lovely challenge where I need to remove the jsessionid content from an URI.
https://test.com/web/tabs;jsessionid=07E052F5D
This would be on the server back to the cl...
hooleylist
Jan 24, 2012Cirrostratus
Nice one Nitass 🙂
David, here are a couple of small suggestions:
If the JSESSIONID is in mixed case and/or the value can be more than 9 hex characters you could use the stream expression from my example. Also, you might need to remove the JSESSIONID from redirects. If so, you can add this to Nitass's example in HTTP_RESPONSE:
Check if response is a redirect and the Location header has a jsessionid
if {[HTTP::is_redirect] and [HTTP::header Location] contains ";jsessionid="}{
Remove ;jsessionid= up until a ? which starts the query string
HTTP::header replace [string map [list [findstr [string tolower [HTTP::header Location]] ";jsessionid=" 12 "?"] ""] [HTTP::header Location]]
}
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