Re: Erase the cookie sessions

From: Date: Tue, 08 Oct 2002 13:51:59 +0000
Subject: Re: Erase the cookie sessions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-119259@lists.php.net to get a copy of this message
Max Buvry wrote: > > Marek Kilimajer wrote: > > > > You miss closing } > > > > Thanks, but that's a copy-paste error and that's not my problem really. > > mb Solved : my solution for information (before test with url !) <?php if ( !isset($_SESSION['count']) ) $_SESSION['count']= 1; else $_SESSION['count']++; if ( $_SESSION['count'] > 5 ) { $cook_param= session_get_cookie_params(); $life_time= $cook_param['lifetime']; $path= $cook_param['path']; setcookie(session_name(),"",$life_time,$path); echo "<HTML><TITLE>Session and cookie</TITLE><BODY>"; echo "session change<BR>"; echo "hello ! : it's ".$_SESSION['count']."times and the last<BR>"; $_SESSION= array(); //session_unset(); session_destroy(); echo "</BODY></HTML>"; } else { echo "<HTML><TITLE>Session and cookie</TITLE><BODY>"; $cpt = $_SESSION['count']; echo "hello ! : it's ".$_SESSION['count']."times"; echo "<br><br> Information :<br>"; echo "name = ".session_name()."<br>"; echo "id = ".session_id()."<br>"; echo "</BODY></HTML>"; } ?> The problem was setcookie execution after the header sending. mb

« previous php.general (#119259) next »