Re: a simple queston about SETCOOKIE function

From: Date: Wed, 23 Oct 2002 14:03:41 +0000
Subject: Re: a simple queston about SETCOOKIE function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-121086@lists.php.net to get a copy of this message
I vaguely recall something to that effect. I believe you are correct, sir, as regards the cookie being available only to that domain. I, too, need to further research that bit. ----- Original Message ----- From: "Justin French" <justin@indent.com.au> To: "Rick Emery" <remery@emeryloftus.com>; <php-general@lists.php.net> Sent: Wednesday, October 23, 2002 9:00 AM Subject: Re: [PHP] a simple queston about SETCOOKIE function Oooops -- true... I'd have to read the spec to check, but if it's not set... is it assumed to be that of the current domain (the one sending the cookie)?? Justin on 23/10/02 11:55 PM, Rick Emery (remery@emeryloftus.com) wrote: > 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, >> >> >> >

« previous php.general (#121086) next »