Though I'm not so specific about session_id(),
i am using a code in php like this
in a.php
i'm using this code
$_SESSION['sid']=session_id();
when i'm in b.php
, i am echoing the session sid and then unsetting it like this..
echo $_SESSION['sid'];
unset($_SESSION['sid']);
which displays d5tk0123nmj56
again when i am visiting a.php and then b.php i am again getting the same result d5tk0123nmj56
shudnt the second time session sid be different??? because i already unset the session in b.php
..
EDIT:
i am testing it in localhost
ANOTHER EDIT
to explain u all descriptively, .. i am using a cart system, in which first i am checking whether a user is logged in by his email id, hence $_session['logged_user']=user_email is one session.. i am using $_session['sid']=session_id() as a unique session to identify the transaction for a cart, after the user checks out(pays) he may again buy something with his status being logged in, then i must again check whether he is logged in(logged_user thus needs to exist), and for next transaction i want to assign him another value for $_SESSION['sid']=a new session_id();
as i know(may be i am wrong) session_destroy() kills all the user session, and that will destroy the session $_SESSION['logged_user'] also..