Re: Cookie Not Setting..

From: Date: Wed, 11 Jul 2001 13:50:39 +0000
Subject: Re: Cookie Not Setting..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57382@lists.php.net to get a copy of this message
Some things to keep in mind: 1. The cookie can't be read untill the next time you access a page. 2. The cookie can only be red in the same level as it is set (I guess), that means that if you set a cookie in "/my/pages/index.php" you can't read the cookie from a page in "/my/index.php". 3. To really see if the cookie is set you can use Netscape and let it warn you before accepting a cookie, in that way you will see the cookiename and it's value and then you can be sure the cookie is set. 4. You can do the same thing with IE. /Magnus Hammar - The cookiemonster? =) -------------------------------------- > Still no luck. Do I have to read a cookie before any HTML is sent as well? > I know to set it before it is sent but reading? > > Jeff > ----- Original Message ----- > From: "Magnus Hammar" <magnus@programmering.nu> > To: "Jeff Lewis" <jeff@hyrum.net>; <php-general@lists.php.net> > Sent: Wednesday, July 11, 2001 9:30 AM > Subject: Re: [PHP] Cookie Not Setting.. > > >> Try this: >> >> $cookie_name = "wwblCookie"; >> $value = "PLEASE"; >> $exp = time() + (86400 * 365); >> $server = "www.domain.com"; // Or IP-address will also do fine >> // the domain must cuntain three "." >> // as in ".somedomain.com" >> $secure = 0; >> setcookie($cookie_name, $value, $exp, "/", $server,$secure);

« previous php.general (#57382) next »