Forum Discussion
Osama_Friejeh_6
Mar 11, 2008Historic F5 Account
add cookie in http response after 302 redirect
Hi,
i am load balancing three web servers that require authentication and persistence. all work fine until certain links return a 302 redirect. the connection is load balanced to a new membe...
Nicolas_Menant
Employee
Mar 11, 2008Hi,
it is strange. The BIGIP should insert the cookie persistence even on redirect ...
i did a test and i confirmed it:
GET / HTTP/1.1
Host: www.google.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PREF=ID=b72527e22a544d83:TM=1204207469:LM=1205017595:GM=1:S=f1MJLoItaQlNuQcj
HTTP/1.x 302 Found
Location: http://www.google.fr/
Cache-Control: private
Content-Type: text/html
Server: gws
Content-Length: 218
Date: Tue, 11 Mar 2008 12:44:39 GMT
Set-Cookie: BIGipServerPool_Google=1753699793.20480.0000; path=/
I think you may have an issue where the cookie is not stored correctly within your browser because the hostname of the website is not a FQDN. If you want to check the bigip insert correctly its persistence cookie within the http redirect you can do the following :
Could you try something like this:
when HTTP_REQUEST {
set request [HTTP::request]
}
when HTTP_RESPONSE {
loop through each of the cookies in the response
if {[HTTP::cookie count] > 0 } {
foreach aCookie [HTTP::cookie names] {
if the current cookie matches the format for the persistence cookie, modify it
if { $aCookie contains "BIGipServer"} {
set the domain attribute on the persistence cookie
log local0. "HTTP request: $resquest"
log local0. "HTTP cookie: [HTTP::cookie $aCookie]"
}
}
}
}
If you changed the cookie persistence name, please update the line $aCookie contains "BIGipServer"
Once this iRule is assigned to your VS, check your /var/log/ltm to see if it is inserted within your expected answer
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