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 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 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 =) 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? 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
Archived
This topic is now archived and is closed to further replies.