Re: a simple queston about SETCOOKIE function

From: Date: Wed, 23 Oct 2002 06:06:21 +0000
Subject: Re: a simple queston about SETCOOKIE function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-121036@lists.php.net to get a copy of this message
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 (#121036) next »