Forum Discussion
JSESSION ID and redirect
iRULE1 : I have a VIP which will redirect to specific URI when they see the HTTP Request which works fine and i have an irule for same which is below :
===== when HTTP_REQUEST { if { not ([HTTP::uri] starts_with "/example") } { HTTP::uri /example[HTTP::uri] }
}
iRULE2 : And i have below JSESSIONID irule which is based on cookie persistence.
===== when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] } } when HTTP_REQUEST { if { [HTTP::cookie exists "JSESSIONID"] } { persist uie [HTTP::cookie "JSESSIONID"] }
}
when i have these 2 iRules together on a VIP, redirect request works, but jsession ID doesnt persist, but when i remove the iRULE1 from the iRule list, JSESSION ID persist. I would like to have an iRule where both the condition meets here. let me know if someone can help
2 Replies
- TechT
Nimbostratus
bump - VernonWells
Employee
Structurally, those should work together. I suspect that, when you perform the transparent rewrite, the server does not set the JSESSIONID for that set of URIs. That is, if a request is made for
then JSESSIONID is not set. That would explain why the second iRule does not appear to fire when the first is set. It's trivial to test. Change iRule 2 as follows:http://your.site.com/example/...when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] } else { log local0. "No JSESSIONID cookie is present in the response" } }Then check
/var/log/ltmafter making a request.If my suspicion is correct, then the fix requires a change to the server behavior, rather than BIG-IP (or you could switch to BIG-IP Cookie persistence).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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