Persist On Last JSESSIONID in HTTP Parameter
Updated Jun 06, 2023
Version 2.0Was this article helpful?
more efficient code:
when CLIENT_ACCEPTED {
set debug 1
}
when HTTP_REQUEST {
set path [HTTP::path]
set logTuple "[IP::client_addr]:[TCP::client_port] - [IP::local_addr]:[TCP::local_port]"
if {[set last_jsessionid_pos [string last "jsessionid=" $path]] ne -1} {
if {[set semicolon_pos [string first ";" $path $last_jsessionid_pos]] ne -1} {
set session_id [string range $path [expr {$last_jsessionid_pos + 11}] [expr {$semicolon_pos -1}]]
} else {
set session_id [string range $path [expr {$last_jsessionid_pos + 11}] end]
}
Persist on the parsed session ID for X seconds
if {$debug}{log local0.debug "$logTuple :: Single JsessionID in: [HTTP::host][HTTP::uri]"}
persist uie $session_id 86400
}
}