Forum Discussion
Aaron_Magruder_
Nimbostratus
Feb 22, 2005Insert Cookie for a different domain
Is it possible to insert a cookie for domain xyz.domain.com when a customer visits abc.domain.com, then redirect them to xyz.domain.com?
When the customer gets redirected, I would like...
Aaron_Magruder_
Nimbostratus
Feb 23, 2005I had the ckname and ckdomain set incorrectly. After correcting this issue, the redirect works. If the cookie is not presented to aac1, you are redirected back to aac to get a cookie.
Thanks for your help.
when CLIENT_ACCEPTED {
set ckname acc1
set ckvalue [IP::client_addr]
set ckdomain domain.com
set cookie [format "%s=%s; path=/; domain=%s" $ckname $ckvalue $ckdomain]
}
when HTTP_RESPONSE {
HTTP::respond 302 Location "http://acc1.domain.com" "Set-Cookie" $cookie
}
rule aac1
when CLIENT_ACCEPTED {
set ckname acc1
set ckvalue [IP::client_addr]
set ckdomain domain.com
}
when HTTP_REQUEST {
if {[HTTP::cookie exists $ckname]} {
pool Shared-172-29-98-77
}
else {
HTTP::redirect "http://acc.domain.com"
}
}
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
