Persist On Last JSESSIONID in HTTP Parameter
Problem this snippet solves: This iRule was written with the goal to persist on only the last jsessionid that is present when multiple jsessionid HTTP Paremeters are present.. How to use this snipp...
Updated Jun 06, 2023
Version 2.0Jason_Adams
Employee
Joined February 28, 2013
Stanislas_Piro2
Apr 05, 2017Cumulonimbus
Hi,
you can do it with a simpler code:
when HTTP_REQUEST {
set parameters [findstr [HTTP::path] ";" 1]
foreach parameter [split $parameters ";"] {
scan $parameter {%[^=]=%s} name value
if {$name equals "jsessionid"} {set session_id $value}
}
if {$session_id ne ""}{
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
}
}