IT_Support_5777
Sep 28, 2007Nimbostratus
Cookie Peristence ASP Session ID
I would like to get some help with the following iRule:
when HTTP_RESPONSE {
if { [HTTP::cookie exists "ASP.NET_SessionId"] } {
persist add uie [HTTP::cookie "ASP.NET_SessionId"]
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "ASP.NET_SessionId"] } {
persist uie [HTTP::cookie "ASP.NET_SessionId"]
}
}
this looks at the ASP.NET session ID cookie and directs the LTM to send traffic back to the responding server, which is critical for our application. But we have a mixture of ASP and ASP.NET servers and I need the same thing done there. ASPSESSIONID is not so easy though...
We need to be able to do the same thing with the ASP sites as is done with the ASP.NET sites.
The problem is, the ASPSESSIONID cookie changes. It has what looks like a unique identifier on the end of the string. Two examples are given below from two different servers:
HTTP/1.1 200 OK
Date: Fri, 28 Sep 2007 14:44:30 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 3080
Content-Type: text/html
Expires: Thu, 27 Sep 2007 22:04:30 GMT
Set-Cookie: ASPSESSIONIDSCSTRBCS=ADFSGDLOACOMNHJFKAHDEGEEFD; path=/
Cache-control: private
HTTP/1.1 200 OK
Date: Fri, 28 Sep 2007 14:54:05 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 3080
Content-Type: text/html
Expires: Thu, 27 Sep 2007 22:14:05 GMT
Set-Cookie: ASPSESSIONIDQCDQSDAA=KAJBFABCDFDSFGDJKPEPPNFK; path=/
Cache-control: private
Is there any way to capture these? it looks as though I need to be able to parse the variable to do some logic.