criostage Posted October 10, 2011 Share Posted October 10, 2011 Hi, i m playing arround with php sessions and just started afew testing on it (i never actually used them so i m discovering something new) and i would like to know how can you terminate an PHP Session without closing your browser. For testing i did this small code, just to see the behavior: <?php session_start(); $id = session_id(); echo $id; session_unset(); session_destroy(); ?> The code above seens only to kill the $_SESSION's variables but what i would like is to Kill the PHPSESSID cookie/session cookie. is there anyway you can achive that? thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/248794-terminating-an-php-session-without-closing-browser/ Share on other sites More sharing options...
titan21 Posted October 10, 2011 Share Posted October 10, 2011 You can use bool session_regenerate_id () which will regernate a new session with a new id - effectively making the previous session redundant Quote Link to comment https://forums.phpfreaks.com/topic/248794-terminating-an-php-session-without-closing-browser/#findComment-1277699 Share on other sites More sharing options...
criostage Posted October 10, 2011 Author Share Posted October 10, 2011 You can use bool session_regenerate_id () which will regernate a new session with a new id - effectively making the previous session redundant Thank you very much =) Quote Link to comment https://forums.phpfreaks.com/topic/248794-terminating-an-php-session-without-closing-browser/#findComment-1277768 Share on other sites More sharing options...
titan21 Posted October 10, 2011 Share Posted October 10, 2011 No worries- can u mark the thread as Solved for me? Quote Link to comment https://forums.phpfreaks.com/topic/248794-terminating-an-php-session-without-closing-browser/#findComment-1277782 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.