Forum Discussion
Kevin_Stewart
Employee
May 08, 2007Where do session cookies live?
This is a quick question that I hope is easy to answer.
When a BigIP (9.x) creates a cookie, clearly its a "session" (in-memory) cookie, and not a file-based cookie. Where then is that cookie stored? In BigIP server memory or client memory? Also, is there a way for multiple connections (to different VIPs) to share that cookie?
Thank you.
Kevin Stewart
4 Replies
- hoolio
Cirrostratus
rule log_cookies_rule { when HTTP_REQUEST { if {[HTTP::header exists "Cookie"]}{ foreach aCookie [HTTP::cookie names] { log local0. "Cookie: $aCookie=[HTTP::cookie $aCookie]" } } } when HTTP_RESPONSE { foreach aCookie [HTTP::cookie names] { log local0. "Cookie: $aCookie=[HTTP::cookie $aCookie]" } } }
when LB_SELECTED { get the pool name used for this request set my_pool [LB::server pool] } when HTTP_RESPONSE { Check if the persistence cookie exists in the response if {[HTTP::cookie exists "BIGipServer$my_pool"]} { set the domain attribute on the persistence cookie HTTP::cookie domain "BIGipServer$my_pool" ".example.com" } }
when HTTP_RESPONSE { Check if the persistence cookie exists in the response if {[HTTP::cookie exists "MY_PERSIST_COOKIE_NAME"]} { set the domain attribute on the persistence cookie HTTP::cookie domain "MY_PERSIST_COOKIE_NAME" ".example.com" } }
- Kevin_Stewart
Employee
Thanks Aaron. I think I'll be able to work with what you've given me. Oddly, our intentions are quite different than what you expected. We have a "portal" product that we secure with client cert authentication and ocsp. Some of the resources within the portal are not "portalized", meaning they aren't rendered from within the portal. The user must request the objects on their own. In an attempt to keep the user from having to re-authenticate their client certificate, as is policy for every web application, we need to turn off client certificate request. In doing so though, we need to make sure that the client is already authenticated at the main site. So the idea is to create a session cookie at the portal with the given domain. When the user receives a redirect for content on another host, the BigIP needs to make sure that a session cookie exists from the portal. If it doesn't, then redirect the user to the main portal login page. It is then important to know whether VIPs can share session cookies, which you've verified. The question of where the session cookie lives is of greatest importance to our IA group. Although session cookies should go away when the browser is closed, the data may actually remain in memory until written over. I know this sounds paranoid, but we may still need to insert some encrypted TTL data into the cookie so that it actually expires. - Michael_Everet1Historic F5 AccountHoolio - Thanks for the post, helpful.. I have not needed to use iRules beyond simple redirects from HTTP to HTTPs and pool selection based on URI.. However, during our migration from v4 to v9 BigIP's we noticed a change in behavior on how the v9 BigIP (v9.1.2) handles cookie insert. In version 4, if the client present a BigIP cookie, the bigip would continue to set the same cookie on subsequent 200 responses. In v9, this is no longer the case. Unfornately, we have some apps that function a middle-man between our BigIP and the client, they work with the BigIP persistence cookie. They require the cookie be set on all 200 responses (or so it appears).. V9 broke the app, but I think an iRule can be used to work-around. Below is a snapshot of the rule that I have working in a lab environment. I would appreciate any comments/suggestions..Or, is there a simpler approach.. Note: logging statements are just for debug, will be removed....
- Michael_Everet1Historic F5 AccountThanks for the response...
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