PleaseHelpMe_10
Nimbostratus
Apr 17, 2012Disappearing Cookies
First off please excuse my ignorance on this topic, I am very new to this and I am still learning. I'd like to thank everyone in advance for their time and their responses.
Here is my irule:
when HTTP_REQUEST {
Set Variables for manipulation later
set URL [HTTP::host]
set URI [HTTP::uri]
set query [URI::query "$URI"]
set referrer [HTTP::header "referrer"]
set useragent [HTTP::header "User-Agent"]
set cookies [HTTP::cookie names]
Keep requests from going through if they already have the information needed to authenticate successfully.
if {"$URI" contains "SSO" && !("$URI" contains "pfidpadapterid") && !("$URI" contains "favicon.ico")}
{
if {"$useragent" contains "MSIE"}
{
HTTP::cookie insert name "pfidpaid" value "IWA" path "/" domain ".yum.com" version 0
HTTP::cookie insert name "referrer" value "$referrer" path "/" domain ".yum.com" version 0
foreach cookie [HTTP::cookie names] {
log local0. "Cookie $cookie = [HTTP::cookie value $cookie]"
log local0. "Cookie $cookie path = [HTTP::cookie path $cookie]"
log local0. "Cookie $cookie domain = [HTTP::cookie domain $cookie]"
log local0. "Cookie $cookie expires = [HTTP::cookie expires $cookie]"
}
}
else
{
HTTP::cookie insert name "pfidpaid" value "TAMLDAP2" path "/" domain ".yum.com" version 0
HTTP::cookie insert name "referrer" value "$referrer" path "/" domain ".yum.com" version 0
HTTP::cookie expires "referrer" 3600 relative
foreach cookie [HTTP::cookie names] {
log local0. "Cookie $cookie = [HTTP::cookie value $cookie]"
log local0. "Cookie $cookie path = [HTTP::cookie path $cookie]"
log local0. "Cookie $cookie domain = [HTTP::cookie domain $cookie]"
log local0. "Cookie $cookie expires = [HTTP::cookie expires $cookie]"
}
}
}
else
{
return
}
}
As you can see I am setting a couple of cookies in the HTTP_REQUEST. I can see these cookies in the LTM log via the logging that I have setup, but I am unable to see these cookies in the browser using a tool like the FireFox plugin "Web Developer".
I tried using the HTTP::cookie expires functionality, but it appears that you can only do that in the HTTP_RESPONSE and when I check for that cookie in HTTP_RESPONSE I cannot find it.
At first I thought this was the backend server deleting the cookies, but I setup a virtual server that was pointing to a basic Apache web server and used a static HTML page to test this irule and I was still unable to see the cookies that were set.
Any help that you can provide on this would be most appreciated. Thank you again in advance.