Forum Discussion
Andy_Herrman_22
Apr 24, 2008Nimbostratus
Sounds like you got it working, but I think I saw a bug in your iRule that could cause some problems later on.
To get the session ID out of the URL you use the following:
set uri_id [findstr $uri "jsessionid=" 11 "?"]
This will get the string after "jsessionid=' until a "?" is found. However, URL parameters are delimited by a "&", not a "?". So, if you have a url like this:http://somedomain.com/some/path?jsessionid=MYSESSIONID
it'll work fine, but if you have this:http://somedomain.com/some/path?jsessionid=MYSESSIONID&someotherparam=FOOBAR
it won't work, as the jsessionid string you get back will end up being "MYSESSIONID&someotherparam=FOOBAR"
If your application doesn't use other query params, or always puts jsessionid as the last query param then it will work, but if any other params are put after jsessionid then you'll get the wrong value.