Re: an easy destroying session issue...

From: Date: Wed, 02 Apr 2008 14:44:58 +0000
Subject: Re: an easy destroying session issue...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-272448@lists.php.net to get a copy of this message
On Wed, Apr 2, 2008 at 10:34 AM, pere roca <peroc79@gmail.com> wrote: > > <?php > session_start(); > $_SESSION = array(); > session_destroy(); > > $userid = safehtml($_POST['userid']); > session_start(); > > //$sessionid can be used to retrieve the current name and session id as a > string > $sessionid=session_id(); > //userid can be re-used as a variable in other php files > session_register("userid"); > > After leaving the page and coming back, without closing the browser, and > performing a SQL sentence like "insert into user_table values > ('$userid','$sessionid')"; I get sessionid is still the same!! > why¿? This is expected behavior. Calling session_destroy() only removes the data associated with the session. To kill the PHPSESSID value, RTFM: http://php.net/manual/en/function.session-destroy.php -- </Daniel P. Brown> Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Just ask!

« previous php.general (#272448) next »