Hello,
For a web application, I decided to store the sessions variables into a database. Everything is working like I want except for the logout, in which I thought that with a simple session_destroy() will do the job but is not.
As I mention all the session information is stored in the database, but I notice that when calling session_destroy(); it does delete the session from the database but is not deleted from the server. I notice that if I do not close the browser, every time I loggin I get the same session id, therefore if I loggin with different username, I still get the same session id. How can I delete server session?
This is a function within a class that I use to destroy the session:
function destroy( $id ) {
// Build query
$newid = mysql_real_escape_string($id);
$sql = "DELETE FROM sessions_table WHERE session_id = '{$newid}'";
mysql_query($sql);
return TRUE;
}
Any advice please?