Re: Erase the cookie sessions

From: Date: Tue, 08 Oct 2002 11:33:59 +0000
Subject: Re: Erase the cookie sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-119228@lists.php.net to get a copy of this message
You miss closing } Max Buvry wrote:
Hi, I wish test the session. I use php 4.2.3 et session.auto_start is 1. My first example is : <html> <head> <title>Session example</title> <body> <?php if ( !isset($_SESSION['count']) ) { $_SESSION['count']= 1; } else { $_SESSION['count']++; } if ( $_SESSION['count'] < 5 ) { $cpt = $_SESSION['count']; echo "hello ! : $cpt times"; }
else { setcookie(session_name(),""); // setcookie(session_name(),"","","/"); $cpt = $_SESSION['count']; echo "Session change<BR>"; echo "hello ! : $cpt times"; session_unset(); session_destroy(); } ?> </body> </html> I don't find the solution to use setcookie ; I try the two instructions above (the script is correct without the "else"). An idea ? In advance, thanks. mb


« previous php.general (#119228) next »