Forum Discussion
colincashin_171
Oct 27, 2012Nimbostratus
Thanks nitass@ and hoolio@
The code snippet I included is indeed incorrect - the phpsessid is set in the set-cookie response from the server and not HTTP::path. I had a look at the Universal Profile section (http://support.f5.com/kb/en-us/solutions/public/7000/300/sol7392.html) and read through all options around HTTP::cookie and found that this greatly simplified approach works perfectly! I had completely over-engineered the solution for what I was trying to achieve.
What I now have in place (and works perfectly) is:
when HTTP_RESPONSE {
if { [HTTP::cookie exists "PHPSESSID"] } {
persist add uie [HTTP::cookie "PHPSESSID"]
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "PHPSESSID"] } {
persist uie [HTTP::cookie "PHPSESSID"]
}
}
Whats key is that in
persist add uie [HTTP::cookie "PHPSESSID"]
the HTTP::cookie name snippet: this gets the value of an existing cookie with the given name so it extracts the 26 character phpsessid from the set-cookie headers. Nice! Then we just persist based on this. Thanks for the assistance folks. I'm looking forward to making positive contributions to the community as I learn more about the platform 🙂