F5 tech support suggested we write an iRule to keep a customers session on the same server with the www.mycompany.com but I’m new to iRules and don’t have a clue where to start.
I’ve seen some examples here but nothing like what we need.
I’m not positive on this, but I think you should be able to set a domain on the persistence cookie that would tell the client to present the cookie for any request to a subdomain on the domain you specify. This works when the node is setting the cookie, but I’m not certain it will work with a cookie the BIG-IP is setting itself.
Can you test it and report back? Note that you’ll need to change the name of the cookie you’re looking for, from my_persistence_cookie.
when HTTP_RESPONSE {
if {[HTTP::cookie count] > 0 } {
foreach aCookie [HTTP::cookie names] {
if { $aCookie == "my_persistence_cookie" } {
HTTP::cookie domain $aCookie mycompany.com
}
}
}
}
[EDIT: fixed the setting of the domain on the cookie…and removed an extra pair of curly braces]
Is the cookie name you mention in the iRule “BIGipServer”. The servers are not creating their own cookie. We let the LB automatically do the cookie insert for us now.
If this fails, try using a browser plugin like HTTPwatch for IE or LiveHttpHeaders for FF to see exactly what the client is receiving.
Also, the ability to configure a domain on the persistence cookie might be a good feature to have included by default. If you think so, you might consider opening a case with support and asking for this feature to be added.
i have 2 vip address for http and https and multiple subdomain .abc.com
when i browse www.abc.com then searchin some buyable material then i try to buy it, it redirect to https:// then i change the url in browser xxx.abc.com and then request the same page, i loose my login, it means i loose my persistency, i see multiple different persistency values
what can be problem
not: i use same pool for http and https vip address
Do you see the correct domain being set on the persistence cookie? Do you see the client send the persistence cookie when you move from the first VIP to the second VIP?