i’ve configured wamp in my system, and am doing the development cum testing in this local environment. i was working on the logout functionality, and happened to notice that the session ids being generated are same within the browser.
Eg – chrome always generates session id = abc, for all users even after logging out and logging in; IE always generates session id = xyz, for all users.
Is this an issue with wamp/ my test environment?
please find below my logout php script –
<?php
session_start();
$sessionid = session_id();
echo $sessionid;
session_unset();
session_destroy();
?>
You probably still have the cookie with the old session ID in it as neither
session_unsetnorsession_destroydeletes that cookie:So use
setcookieto invalidate the session ID cookie after logout:Another recommendation is to regenerate the session ID after successful authentication using
session_regenerate_id(true).