NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to setcookie with two domains

Phil Powell soazine at erols.com
Mon Oct 14 17:58:46 EDT 2002


That I figured.. which leads to a dilemma:

I can set cookies to *.domain1.com, however, I am having to also set a
cookie value, the same cookie value, to a few remote scripts on
*.domain2.com, and since setcookie can't be used twice (I tried doing that
and only *.domain1.com was set, *.domain2.com was not), I don't know of an
easy solution to set the values of both domains in at least one script?

Phil
----- Original Message -----
From: "Michael Sims" <jellicle at inch.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Monday, October 14, 2002 5:31 PM
Subject: Re: [nycphp-talk] How to setcookie with two domains


> 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
>
>
> --- Unsubscribe at http://nyphp.org/list ---
>
>




More information about the talk mailing list