NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to setcookie with two domains

Michael Sims jellicle at inch.com
Mon Oct 14 17:27:50 EDT 2002


On Monday 14 October 2002 17:11 pm, Phil Powell wrote:

> Is it possible, w/o using sessionid session variables, to use setcookie
> to set a cookie that will have two domains or more?
>
> Just curious.  I am having to set a cookie that will go to one domain
> and then to another domain.  Not sure if I can do multiple setcookie
> commands and be able to produce the desired results.

I'm not entirely sure I understand your question, but it would be a 
security hole to allow cookies to be set for domains other than the 
originating one.  The website www.foo.com can set cookies for www.foo.com 
(sent only to www.foo.com) or .foo.com (sent to any *.foo.com site) but 
can't (shouldn't be able to) set cookies for cnn.com or any other domain.


-- 
Michael Sims



More information about the talk mailing list