Forum Discussion
Robert_47833
Altostratus
Apr 16, 2013how to insert cookie for 2 domains
in HTTP::response event
HTTP::cookie insert name "test" value "00" path "/" domain "x.com"
besides this,I also want this cookie "test" be set in domain "xy.com"
is the second cookie tes...
hoolio
Cirrostratus
Apr 16, 2013Hi Robbie,
By design, one web service can't set a cookie for a different domain. See these wiki pages for details:
http://en.wikipedia.org/wiki/Same_origin_policy
http://en.wikipedia.org/wiki/HTTP_cookie
Do you own both domains? If so, you could potentially use an HTTP redirect to force the client to make a request to xy.com after they make a request to x.com:
HTTP::respond 302 Location "http://site2.xy.com/index.html" Set-Cookie "my_cookie_name=my_cookie_value; Domain=.x.com; Path=/"
This would send a 302 redirect to an xy.com subdomain with a cookie set for x.com.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
