Re: Re: cookies

From: Date: Thu, 11 Jul 2002 11:19:20 +0000
Subject: Re: Re: cookies
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-107096@lists.php.net to get a copy of this message
Surely it would be better to use Sessions in this case? "Danny Shepherd" <danny@kyboshed.com> wrote in message news:08c501c22825$932917c0$0200a8c0@DANNYS... > No, I just tested it myself - if you set a cookie with no expire date it > exists until the browser window is closed. > > My code: > > <?php > > if (!isset($_COOKIE['TestCookie'])) > { > setcookie ("TestCookie", "FUD"); > echo "Just Set a cookie - reload the page"; > } > else > { > echo "Cookie is : {$_COOKIE['TestCookie']}<br>Close the window then return > and the cookie should be gone"; > } > > ?> > > HTH > > Danny. > > ----- Original Message ----- > From: "vins" <vins@webonline.co.za> > To: <php-general@lists.php.net> > Sent: Wednesday, July 10, 2002 3:34 PM > Subject: [PHP] Re: cookies > > > > Nope thats not they way.... > > If you don't specify a expire date it will live for ever or until you > delete > > it. > > > > The only way is to set it with an expiry date and then it will delete > > it'self when the browser closes. > > Check this by running a file on the same domain with phpinfo(); > > > > > > "Alexander Ross" <alexross@bleen.net> wrote in message > > news:20020710134339.68660.qmail@pb1.pair.com... > > > How can I set a cookie which expires when the borwser is closed?? How > can > > I > > > delete a cookie via PHP? > > > > > > Thanks > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#107096) next »