Page 1 of 1

destroying a session ID

Posted: Thu Jun 19, 2003 4:20 pm
by m@ndio
Hi,

I am trying to create a session, display the session ID and then close the session.

At the moment it creates the session, displays the session ID but when you refresh the page the session ID stays the same.. I want this ID to change! It should becuase I deleted the session?

Is there a fix for this? Please comment on how I have coded it, have I done this correctly? Any feedback is welcome.

I hope this makes sense.

Here is my code:

Code: Select all

session_start();

$_SESSION['test'] = session_id();

echo $_SESSION['test'];

$_SESSION['test'] = array();

session_destroy();

Posted: Thu Jun 19, 2003 4:33 pm
by Galahad
Look at this post. delorian has a good post on destroying sessions.