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 cou...
Meena_60179
Nimbostratus
May 05, 2010Sorry 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 using
when 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
}
}
My virtual server has authserver_pool as its default pool. appserver_pool has two nodes. Virtual server has http profile only. everything else is default. On an average I receive HTTP request in every 15 seconds from same client. And log shows this :
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
I am not sure why request goes to 2nd node when I am persisting session for an hour. Someone plzzzzzzzzzz help me. I have no clue here. I would greatly appreciate your help.
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
