Answer the question
In order to leave comments, you need to log in
Destroying a session on a php site?
Hello! There was a problem with destroying sessions. I need to make it possible to destroy the session on all devices, for example, which has the value $_SESSION['name'] = 'Kirill';.
That is, as in VKontakte "end all sessions."
Help me please!
Answer the question
In order to leave comments, you need to log in
A regular PHP session is tied to a cookie for one browser. It is enough to make session_unregister to delete a specific variable in it.
In PHP, a session is associated with a single browser via a cookie, and by default is stored in a separate file in the
session.save_path directory .
If you want to clean it with your hands, grab the files with the entry of the desired line in the folder and delete them.
If you need a reliable automatic mechanism, write your own session handler .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question