Forum Moderators: coopster

Message Too Old, No Replies

Can't kill session

         

salewit

2:27 am on Jun 13, 2008 (gmt 0)

10+ Year Member




<?php
session_start();
$sid=session_id();
echo "$sid";
session_destroy();
session_unset();
?>

Outputs:

4285197332ae1be47f1c6b96209e2214

If I run this code again, I get the same thing:

4285197332ae1be47f1c6b96209e2214

What am I doing wrong? How do I destroy this session ID get a new one? I've tried session_regenerate_id(); and I get the same exact thing.

phparion

6:46 am on Jun 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I believe you will keep getting this same value if you use all functions in the same page. Try this,

make a page where assign value to $sid
then destroy it
make a link on the same which takes to another page
print the $sid on second page
you will get nothing on the second page.