Forum Discussion
Session Timeout using jsession iRule
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } {
persist add uie [HTTP::cookie "JSESSIONID"]
set add_persist 0
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"]
} else {
set jsess [findstr [HTTP::uri] "jsessionid" 11 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}
I need to extend the session timeout period beyond 5 minutes. Modifying the protocol profile does not seem to do the trick. I don't see anything in here that would indicate that there is a variable that I can tweak to get a longer session timeout. Anyone have any ideas??
- JRahm
Admin
What specifically is timing out? The app? TCP? The persistence setting? Idletimeout on the tcp profile will fix tcp timeouts. adding a value in seconds after the persist command will lengthen the persist timeout: - Toby_Penn_11283
Nimbostratus
I'll try adding the 1800 at the end of the persist command. See how that works out. Thanks. - Deb_Allen_18Historic F5 AccountAlternatively, you can apply the rule via a peristence profile of type uie and set the timeout value there. That allows you to change the timeout without having to edit the rule itself -- comes in handy if you want to use the same rule for different apps with different timeout requirements.
- Elias_O_16228
Nimbostratus
I know this is an old thread. Here is my scenario: Two webservers running Java applications. The servers have 1hr timeout keepalive set. We noticed that some customers IP changes with same JSESSIONID, maybe due to proxy. In other words, two IP addresses with one JSESSIONID. I'm not familiar that how one tcp request could have more than one IP address. But to cut the long story short, it's happening. We are seering same JSESSIONID in both servers with different IP addresses.
For example: JSESSIONID23456 with IP address 192.159.9.9 server 01 JSESSIONID23456 with IP address 192.159.10.10 server 02
This causes timeout.
We implemented Source address Affirnity, that did not work. We implemented universal persistence with source-add as fallback, that did not seem to work either.
I need help for irule that will persist to one server based on JSESSIONID.
- Elias_O_16228
Nimbostratus
Below is irule tested but it did not work; 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"] } } - nitass
Employee
are you using oneconnect profile? if not, can you try? sol7964: Persistence may fail for subsequent requests on Keep-Alive connections https://support.f5.com/kb/en-us/solutions/public/7000/900/sol7964.html
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