RE: [PHP] SetCookie weirdness
| From: | scott [gts] | Date: | Wed, 20 Jun 2001 15:31:05 +0000 |
| Subject: | RE: [PHP] SetCookie weirdness | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54553@lists.php.net to get a copy of this message | ||
along with domains, cookies respect directories.
for example:
i'd have a script in '/somewhere'
and another script in '/another'
and when they'd try to use the same cookies,
it wouldnt work...
i had to actually specify a path of '/' for
both of them to be able to use the same cookies.
> -----Original Message-----
> From: Ray Hilton [mailto:me@rayh.co.uk]
> Sent: Wednesday, June 20, 2001 3:26 AM
> To: 'Tomaz Kovacic'; php-general@lists.php.net
> Subject: RE: [PHP] SetCookie weirdness
>
>
> This is actually a security feature of cookies, so that domains that
> dont match your cookie cannot read personal details set by another
> site. Don't worry, its all in order ;)
>
> Ray Hilton
> -
> me@rayh.co.uk
> http://rayh.co.uk
>
> -----Original Message-----
> From: Tomaz Kovacic [mailto:Tomaz.Kovacic@doyen.si]
> Sent: 19 June 2001 12:36
> To: php-general@lists.php.net
> Subject: [PHP] SetCookie weirdness
>
>
> Hi!
>
> Last night I've found some interesting cookie behavior. I was testing
> some script on my local server, so I used short version of domain (
> http://www ) to reach local webserver. My script stopped
> working, so I
> started to investigate a little bit what's goin on..
>
> I've managed to get my script working only when i user SetCookie command
> with only 3 parameters:
>
> SetCookie ("mycookie", $cookie, time()+1200);
>
> My usual form of setting cookie is with all 6 arguments like:
> SetCookie("mycookie", $cookie, time()+1200, "/", ".domain.com",
> 0);
>
> But if I use longer form if domain: www.local (same as
> www.somedomaing.com) my longer form of setting cookie started to work
> again.
>
> Weird.
>
> Anyone experianced similar problems?
>
> Tomaz
>
>
>