Re: an easy destroying session issue...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 2, 2008 at 10:34 AM, pere roca <peroc79@xxxxxxxxx> 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!

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux