Forum Discussion
Meena_60179
Nimbostratus
May 05, 2010Help with JSESSIONID persistence
Hello,
I am using tomcat's JSESSIONID for persistence and I created iRule using this example http://devcentral.f5.com/wiki/default.aspx/iRules/Weblogic_JSessionID_Persistence.html
However I have couple of doubts here, I am not sure that whether I need to configure default persistence profile with the pool or not, if so how can I do that?
Second, when I reload the app with in sessiontimeout period BIG IP sends request to another server, so I want to know why reloading is breaking the persistence setting even though JSESSIONID is with the request.
Thanks for the help.
- Meena_60179
Nimbostratus
Sorry for long post but I think I am missing something here and got no clue somehow my persistence is not configured properly, here is the exact irule I am usingwhen HTTP_REQUEST { set uri [ HTTP::uri ] if { $uri contains "myapp" } { find out if session id is defined set sessionId [ HTTP::cookie "JSESSIONID" ] log "request for $uri , when sessionId is -- $sessionId " if { $sessionId == "" } { look for auth cookie set authCookie [ HTTP::cookie "auth" ] set location [HTTP::cookie "server_location" ] if { $authCookie != "" and $location != "" } { if { $location equals "myapp" } { pool appserver_pool } } else { HTTP::redirect "http://10.0.0.1/auth/" } } else { persist session persist uie $sessionId 3600 set location [ HTTP::cookie "server_location" ] log "SessionId not null location is $location " if { $location equals "myapp" } { pool appserver_pool } } } elseif { $uri contains "auth" } { log "request for $uri , when no session JSESSIONID is [HTTP::cookie "JSESSIONID"] " pool authserver_pool } } when HTTP_RESPONSE { HTTP::header replace "Server IP" [ IP::server_addr ] log "Server Address [IP::server_addr] " set sessionId [ HTTP::cookie "JSESSIONID" ] if { $sessionId ne "" } { log "app server has set JSESSIONID $sessionId add persistence" persist off session id for an hour (3600 seconds).. persist add uie $sessionId 3600 } }
Wed May 5 01:11:23 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.1 Wed May 5 01:11:23 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331 Wed May 5 01:11:10 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.1 Wed May 5 01:11:09 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331 Wed May 5 01:10:56 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.2 Wed May 5 01:10:56 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331 Wed May 5 01:10:43 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.2 Wed May 5 01:10:43 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331 Wed May 5 01:10:30 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.2 Wed May 5 01:10:30 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331 Wed May 5 01:10:17 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _persist_sessionId_on_resposne : Server Address 192.168.1.1 Wed May 5 01:10:17 PDT 2010 info local/tmm tmm[4117] 01220002 Rule _validate_request : request for /myapp/poll , when sessionId is -- C195535A841C7D81985E33F2DFA51331
- Meena_60179
Nimbostratus
Can someone please help me here, please let me know if I am missing any information here since I am new to this group. Hoping for getting some help. - L4L7_53191
Nimbostratus
Meena: Try enabling oneconnect, and use a mask of 255.255.255.255. See SOL7964, hopefully this helps. Either way, update when you give it a try. - Meena_60179
Nimbostratus
First of all thanks a lot for the reply. - L4L7_53191
Nimbostratus
Can you send over the virtual server configuration as well? - Meena_60179
Nimbostratus
Sorry for asking, how can I do that? can I take configuration from some file via command line? - L4L7_53191
Nimbostratus
You can look at bigip.conf for the relevant stuff, or just do a "b virtual show" from the CLI. It may be a while before I can look at this though - have you opened a support ticket? It's likely they can help you solve this quickly. - Meena_60179
Nimbostratus
Thanks for the reply Matt, can anyone open a support ticket with F5, I was thinking one needs a support contract with them. can you please tell me how can I do so since I do not have access to web portal and I want to fix this problem asap. - Meena_60179
Nimbostratus
I opened a case with F5 support, they think iRule is fine its NTP issue with BIG-IP LTM 10.1. I turned off NTP and set dates manually to GMT to all my servers and BIG-IP. I can still reproduce this issue. I am using universal persistence and LTM drops persistent record after some time (say 9-10 minutes). I converted my iRule to be the simplest all I have iswhen HTTP_RESPONSE { log "Server Address [IP::server_addr]" if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] 3600 } } when HTTP_REQUEST { log "request for [ HTTP::uri ] , when sessionId is -- [HTTP::cookie "JSESSIONID"] " if { [HTTP::cookie exists "JSESSIONID"] } { persist uie [HTTP::cookie "JSESSIONID"] 3600 } }
- L4L7_53191
Nimbostratus
I just had a moment to look at this. Unfortunately, I simply can't replicate your problem...I'm persisting OK (for 10 or so minutes) with the same rule you've got above. If I delete my JSESSIONID cookie I flip to the other box, then persist there.
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