I would like to close a session id without closing the browser. Is session_destroy(); allows to do that ? Thanks
Yes create like a logout.php page and do <?php session_start(); session_destroy(); ?> Code (markup): and that will destory the current session
Thanks for your reply, but the session_destroy doesn't regenerate a session_id mya be because i use a virtual server on my local machi
Oh you should have said thats what you needed silly lol .. <?php session_start(); session_regenerate_id(); echo "new session id " . session_id(); ?> Code (markup): you might want to session_destroy(); the old session though. <?php session_start(); session_destroy(); session_regenerate_id(); echo "new session id " . session_id(); ?> Code (markup): I never tried the above way
thanks i found this code it works fine: <?php session_start(); $old_sessionid = session_id(); session_regenerate_id(); $new_sessionid = session_id(); echo "Old Session: $old_sessionid<br />"; echo "New Session: $new_sessionid<br />"; print_r($_SESSION); ?> regards frank