Re: a simple queston about SETCOOKIE function
| From: | Rick Emery | Date: | Wed, 23 Oct 2002 13:55:55 +0000 |
| Subject: | Re: a simple queston about SETCOOKIE function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121083@lists.php.net to get a copy of this message | ||
You do not HAVE TO set the domain. The only required parameters are Cookie name and value
----- Original Message -----
From: "Justin French" <justin@indent.com.au>
To: "Mehran Ziadloo" <mehran20@hotmail.com>; <php-general@lists.php.net>
Sent: Wednesday, October 23, 2002 1:06 AM
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