ASP stickiness with multiple cookies
Hi, i know that there's is already a codeshare example for this kind of stickiness but i need an extension and i don't know how to set up the rule.
I set up the following IRule:
when HTTP_REQUEST {
set SessionId [HTTP::cookie ASP.NET_SessionId]
log local0. "Request SessionId is: $SessionId"
if { $SessionId != "" } { persist uie $SessionId }
}
when HTTP_RESPONSE {
set SessionId [findstr [HTTP::header Set-Cookie] "ASP.NET_SessionId" 18 24]
log local0. "Response SessionId is: $SessionId"
if { $SessionId != "" }{ persist add uie $SessionId }
}
which works fine for the request but not the response. the problem is that the server sends 4 'Set-Cookie' statements and the 'ASP.NET_SessionId' is the first one in the list.
this is what the server responds:
Set-Cookie: ASP.NET_SessionId=edfozx45o40stpfgnbtue045; path=/; HttpOnly
Set-Cookie: EPowerV4Users=carrefourvoyagesb2b=13_user; path=/
Set-Cookie: EPowerV4UsersCorporates=carrefourvoyagesb2b=agencyantibes; path=/
Set-Cookie: VisitorID=1703234c-e2be-45a4-a9c3-29183aa09fde; expires=Fri, 23-Nov-2012 07:55:38 GMT; path=/
X-Powered-By: ASP.NET
i found in the wiki the statement forn http:header:
'Note that the command will operate on the value of the last header if there are multiple headers with the same name'
So i would need now an expension of the rule to look at all 'Set-Cookie' headers and apply stickieness
based on the asp session id.
I tried to put together bits and pieces from different other rules but it seems that my skills are not good enough to get it working.
Can someone please help me.