Forum Discussion
João_Assad_4295
Nimbostratus
Mar 22, 2006persistence cookie domain
When using the cookie persistence profile, there is no way to configure the cookie domain. Is there a way to do it via iRules ?
6 Replies
- JRahm
Admin
Check out the wiki: - João_Assad_4295
Nimbostratus
Ok here is the problem. - JRahm
Admin
Take a look at this thread: - João_Assad_4295
Nimbostratus
- - João_Assad_4295
Nimbostratus
my mistake.when HTTP_RESPONSE { if { [HTTP::cookie exists "BIGipServermy_pool"] } { If the cookie does exist, let's grab the contents. set old_cookie [HTTP::cookie BIGipServermy_pool] log local0.NOTICE "OLD: $old_cookie" Now we delete it, then re-insert it with the domain info we want added. HTTP::cookie remove BIGipServermy_pool HTTP::cookie insert name BIGipServermy_pool value $old_cookie domain mydomain.com set new_cookie_domain [HTTP::cookie domain BIGipServermy_pool] set new_cookie [HTTP::cookie BIGipServermy_pool] log local0.NOTICE "NEW: $new_cookie" log local0.NOTICE "NEW: $new_cookie_domain" } }
- João_Assad_4295
Nimbostratus
After some testing I noticed that the iRule above has a problem. If more than one cookie is set on the response, the extra set-cookies will be lost and only the BIGipServermy_pool set-cookie will be sent to the client.when HTTP_RESPONSE { set cookies [HTTP::cookie names] look for a persistence cookie being set if { $cookies contains "BIGipServer" } { rewrites all cookies being set foreach cookie_name $cookies { set cookie_value [HTTP::cookie $cookie_name] HTTP::cookie remove $cookie_name HTTP::cookie insert name $cookie_name value $cookie_value domain "mydomain.com" path "/" } } }
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