Erase the cookie sessions

From: Date: Tue, 08 Oct 2002 10:28:44 +0000
Subject: Erase the cookie sessions
Groups: php.general 
Request: Send a blank email to php-general+get-119223@lists.php.net to get a copy of this message
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 (#119223) next »