Forum Discussion
Eric_Waite_1046
Nimbostratus
Oct 02, 2006persist jsession by uri
I know thi shas be gone over a whole bunch of times, and after alot of playing around I am using an example from a previous post:
What I need to accomplish is to persist by jsessionid, and jsession are only passed by the URI, example: http://beta.reading.com/reading/dispSchoolLogin.do;jsessionid=D0944F90E7592CC6ED780464716B6207
The following is written to the log file:
Mon Oct 2 14:40:13 EDT 2006 tmm tmm[989] Rule AppServerJsessionId HTTP_RESPONSE: jsessionid found, jsess is: 32EA5BBD8ACAAFACFC9239AC3F0F7541
Mon Oct 2 14:40:13 EDT 2006 tmm tmm[989] Rule AppServerJsessionId HTTP_REQUEST: Entering REQUEST, jsess is: 32EA5BBD8ACAAFACFC9239AC3F0F7541
Mon Oct 2 14:40:13 EDT 2006 tmm tmm[989] Rule AppServerJsessionId HTTP_REQUEST: Entering REQUEST, jsess is:
Mon Oct 2 14:40:13 EDT 2006 tmm tmm[989] Rule AppServerJsessionId HTTP_RESPONSE: jsessionid found, jsess is: 72EB37E2571E50803B07EE2B85CFE5FB
Mon Oct 2 14:40:13 EDT 2006 tmm tmm[989] Rule AppServerJsessionId HTTP_REQUEST: Entering REQUEST, jsess is: 72EB37E2571E50803B07EE2B85CFE5FB
The request is not being persisted to the client properly and it is throwig me to the wrong server.
Anyone have any suggestions?
when HTTP_REQUEST {
set uri [HTTP::uri]
set jsess [findstr $uri "jsessionid" 11 "?"]
log local0. "Entering REQUEST, jsess is: $jsess"
if { $jsess != "" } {
persist uie $jsess
}
}
when HTTP_RESPONSE {
if { [findstr $uri "jsessionid"] > 0}{
set jsess1 [findstr $uri "jsessionid" 11 "?"]
log local0. "jsessionid found, jsess is: $jsess1"
persist add uie $jsess1
}
}
Thank you.
Eric
- JRahm
Admin
I am using the session table to accomplish this:when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { set jsessID [lindex [split [HTTP::cookie "JSESSIONID"] "!" ] 0 ] if { [session lookup uie $jsessID] equals "" } { session add uie $jsessID [IP::server_addr] 1800 log local0. "added server entry [session lookup uie $jsessID] for jsessionID $jsessID " } else { log local0. "existing server entry [session lookup uie $jsessID] for jsessionID $jsessID" } } } when HTTP_REQUEST { if { [findstr [HTTP::uri] "jsessionid" 11 "!"] != ""} { pool myApp-pool member [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"] ] log local0. "jsessionID [findstr [HTTP::uri] "jsessionid" 11 "!"] sent to [session lookup uie [findstr [HTTP::uri] "jsessionid" 11 "!"] ]" } else { pool myApp-pool log local0. "No jsession ID, local balancing the connection..." } }
- nick_chen_66997
Nimbostratus
about the request is not being persisted to the client properly,
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