I have read this topic as I was wondering if it's possible to close a session remotely. It is possible I might not be understanding the topic entirely so please let me know.
Ideally if somebody is logged in to my application and then logs again using different PC - I would like to close the other session without using the database.
I've used this:
session_start();
session_id($ns);
session_destroy();
ob_start();
session_start();
session_regenerate_id();
but it doesn't actually destroy the session. Am I doing something incorrectly?
-- edit
Forgot to add few details. I only want to contact the database once - when person logs in again - the current session_id is then added to $ns
variable.
But I don't want to access the DB on each page. Before I log somebody in I am reading the session from DB and trying to destroy it and start a new one.
Changed order of session_start()
and session_id($ns)
and still can't do it