Surely it would be better to use Sessions in this case?

"Danny Shepherd" <[EMAIL PROTECTED]> wrote in message
08c501c22825$932917c0$0200a8c0@DANNYS">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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > 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
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to