Forum Discussion
Stefan_126426
Nimbostratus
Jan 02, 2013Confusing ASP.NET session cookie rewriting with HttpOnly flag version 10
Hi Everyone, first post here so a little introduction.
I am a sysadmin/developer for a large insurance company and have just taken ownership of our F5 box. 12 Years IT experience so I can usuall...
Stefan_126426
Nimbostratus
Jan 03, 2013Hi Nitass
That works perfectly, many thanks for your time and effort.
Could you just confirm I understand this code correctly please? (apologies, this is a new language for me and I like to learn ;-))
set myValues [HTTP::header values "Set-Cookie"] <-- This creates array or equivilent of "Set-Cookie" Headers and values.
HTTP:: header remove "Set-Cookie" <-- removes all headers with "Set-Cookie"
For each, well thats obvious
Now the scan line is a bit more interesting:
scan [lindex $mycookies 0] {%[^=]=%[^;]} currentname currentvalue
OK scan is for parsing strings. I am guessing that lindex $mycookes 0 will actually return the whole string of the cookie including flags and is just a different way of getting these values. There would not be anything in position 1?
Now the next bit looks like a regular expression..But not quite? It seems to say "anything up to the first equals From the first equals anything up to the first semicolon" What I don't get is how this ties into the two variables. How does it define the start and end of a string to go into the variable? Is it simple on the ^=? As ^ appears to be a "stop here"?
The rest of course makes sense.
Once again, many thanks for your time and effort on this, it is greatly appreciated.
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