Forum Discussion
David_Landry
Nimbostratus
Jan 24, 2012Need 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...
hoolio
Cirrostratus
Jan 24, 2012Can you just remove it from the requested URI? If so, you can use an iRule like this:
when HTTP_REQUEST {
Check if the path contains a jsessionid
if {[HTTP::path] contains ";jsessionid="}{
Split the path on the jsession ID and update it to the first field
HTTP::path [getfield [HTTP::path] ";jsessionid=" 1]
}
}
Or if you need to hide the JSESSIONID from the client you'd need to rewrite the response content using an stream profile and STREAM::expression iRule. You could use a STREAM::expression like:
STREAM::expression {@;[jJ][sS][eE][sS][sS][iI][oO][nN][iI][dD]=[a-zA-Z0-9]*@@}
http://devcentral.f5.com/wiki/iRules.stream__expression.ashx
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
