Forum Discussion
Julian_Grunnell
Nimbostratus
Jun 13, 2007Cookie Rewrite & ASPSESSIONID Mk. II
Hi - well looks like my previous post got foobar'd somehow. Anyway thanks to willms & hoolio for their valuable input!!
I amended willms iRule slightly to:
when HTTP_RESPONSE {
...
JRahm
Admin
Jun 13, 2007I also saw occassional issues with cookie persistence, so I use the session table to build the backend pool member reference from the sessionID. Maybe not the most efficient way, but I don't have any issues with it.
when HTTP_RESPONSE {
if { [HTTP::cookie exists "ASPSESSIONID"] } {
if { [session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]] equals "" } {
session add uie $sessionID [IP::server_addr] 1800
log local0. "added server entry [session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]]\
for aspsessionID [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20] "
} else {
log local0. "existing server entry [session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]]\
for aspsessionID [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]"
}
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "ASPSESSIONID"] } {
if { !([session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]] equals "") } {
pool [LB::server pool] member [session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]]
log local0. "aspsessionID [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]
\sent to [session lookup uie [findstr [HTTP::cookie names] "ASPSESSIONID" 12 20]]"
} else {
pool [LB::server pool]
log local0. "No aspsession ID, load balancing the connection..."
}
}
} Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects