RE: [PHP] a simple queston about SETCOOKIE function
| From: | Martin Towell | Date: | Wed, 23 Oct 2002 05:59:12 +0000 |
| Subject: | RE: [PHP] a simple queston about SETCOOKIE function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121037@lists.php.net to get a copy of this message | ||
I think the domain in something like - if you have a page sitting on
some.domain.com.xx
and you only want pages that are being served from that domain to use your
cookie, then you set the domain to "some.domain.com.xx"
but if you want your cookies to also be used on
another.domain.com.xx
then you can set the domain to "domain.com.xx" and both domains can then use
it
-----Original Message-----
From: Justin French [mailto:justin@indent.com.au]
Sent: Wednesday, October 23, 2002 4:06 PM
To: Mehran Ziadloo; php-general@lists.php.net
Subject: Re: [PHP] a simple queston about SETCOOKIE function
Well, you HAVE TO set the domain... I think... Cookies are supposed to be
PER DOMAIN... so that someone on another site doesn't have access to them,
and vice-versa. Obviously there are sneaky companies using work-arounds...
but I believe the domain has to be set.
The path one is usefull on servers where completely different
clients/projects are using different dorectories... like an ISP with this
sort of structure:
isp.com/~username1
isp.com/~username2
Or for an online service with many sub-sections or clients. Setting the
path to /~username1 will prevent ~username2 from gaining access to the
cookie values.
In the case of you running a single domain by yourself, with no worries
about other people within that domain, you just set it to '/' I think...
Justin
on 23/10/02 3:57 PM, Mehran Ziadloo (mehran20@hotmail.com) wrote:
> Hi
>
> Can somebody tell me the meaning of two parameters in setcookie function,
> Path and Domain. I have read the manual and I know what it says but I want
> to know what's the good of them, why should someone use them? Recntly I've
> had a cookie problem and I think my answers are in these two parameters.
>
> Thanks,
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php