Forum Discussion
Andrea_Knapp_28
Nimbostratus
Mar 12, 2008Session intermixing issue - due to Cookie not being sent every call?
we are currently having issues with our v9.3 implementation when we go into production we have session intermixing issues with users who are behind a proxy. Tech Support has stated that there is a difference between v4.5.13 and v9.3 in how the cookie is presented.
This is what tech support has stated :
"In version 4, if the client makes a request and includes the BigIP persistence cookie in the cookie list, the BigIP reads the cookie and load balances accordingly. However, the BigIP continues to set the same cookie in subsequent HTTP 200 responses to the requestor.
In version 9, if the client makes a request and includes the BigIP persistence cookie in the cookie list, the BigIP reads the cookie and load balances accordingly. However, in version 9 the BigIP does not continue to set the same cookie in subsequent HTTP 200 responses"
Their suggestion was to use an iRule in which the cookie is examined everytime and then reinserted back to the customer in v9.3. Here is the iRule that they provided
when HTTP_REQUEST {
if { [HTTP::cookie exists "BIGipServerP_HTTP"] } {
If the cookie does exist, let's grab the contents.
set old_cookie [HTTP::cookie BIGipServerP_HTTP]
}
}
when HTTP_RESPONSE {
Now re-insert it
HTTP::cookie insert name BIGipServerP_HTTP value $old_cookie
set new_cookie [HTTP::cookie BIGipServerP_HTTP ]
}
In which the value for BIGipServerP_HTTP is the same value as the persistent profile cookie that is set for that virtual.
I tried the iRule as written above but it completely broke the site. I believe it broke the site because the rule is based on having a cookie already. If the cookie does not exist how does it get created?
To get it to some what work we had to change it to the following:
when HTTP_REQUEST {
if { [HTTP::cookie exists "BIGipServerP_HTTP"] } {
If the cookie does exist, let's grab the contents.
set old_cookie [HTTP::cookie BIGipServerP_HTTP]
} else {set old_cookie 0}
}
when HTTP_RESPONSE {
Now re-insert it
HTTP::cookie insert name BIGipServerP_HTTP value $old_cookie
set new_cookie [HTTP::cookie BIGipServerP_HTTP ]
}
This is still causing issues as we now can get to the site, but sessions are expiring
Since I am not proficient in creating iRules I need some assistance. I believe what needs to happen is that the cookie needs to be inserted. Is there are way to do the following:
if the cookie exists set to old_cookie
if not then use persitent profile BIGipServerP_HTTP
if old_cookie exists then re-insert and send back to customer.
Thank you,
Andrea
7 Replies
- hoolio
Cirrostratus
Hello, - Andrea_Knapp_28
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
I suppose anything is possible. This poster (Click here) found their issue was fixed by setting the cookie on every response.when HTTP_REQUEST { Determine the persistence cookie name. This assumes it hasn't been customized in the persistence profile. If it has been customized, just hardcode the name here instead. set persist_cookie_name BIGipServer[LB::server pool] Save persistence cookie value if it exists in the request if {[HTTP::cookie exists $persist_cookie_name]} { If the persistence cookie is present in the request, save the value set old_cookie_value [HTTP::cookie value BIGipServer$pool_name] } } when HTTP_RESPONSE { If the response doesn't already have a persistence cookie and the request did, insert the value from the request if {not ([HTTP::cookie exists $persist_cookie_name]) and [info exists old_cookie_value]}{ HTTP::cookie insert name $persist_cookie_name value $old_cookie_value } }
- hoolio
Cirrostratus
Actually, it would make more sense to explicitly unset the value for the request cookie if it's not present, so you don't get a stale value. Can you try this version instead?when HTTP_REQUEST { Determine the persistence cookie name. This assumes it hasn't been customized in the persistence profile. If it has been customized, just hardcode the name here instead. set persist_cookie_name BIGipServer[LB::server pool] Save persistence cookie value if it exists in the request if {[HTTP::cookie exists $persist_cookie_name]} { If the persistence cookie is present in the request, save the value set old_cookie_value [HTTP::cookie value BIGipServer$pool_name] } else { If the cookie wasn't present in this HTTP request, unset the variable so it's not available for subsequent requests on the same TCP connection. unset old_cookie_value } } when HTTP_RESPONSE { If the response doesn't already have a persistence cookie and the request did, insert the value from the request if {not ([HTTP::cookie exists $persist_cookie_name]) and [info exists old_cookie_value]}{ HTTP::cookie insert name $persist_cookie_name value $old_cookie_value } }
- David_Remington
Employee
Posted By aknapp on 03/12/2008 1:25 PM
- hoolio
Cirrostratus
Hi David, I think Andrea was saying she was skeptical that setting a session-based persistence cookie on every response would fix the problem. She mentioned that they were already testing with a OneConnect profile with a /24 netmask but the failure was still occurring. - marcus_63918
Nimbostratus
Andrea - wondering if you ever found the fix for your problem?
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