A
A
Asjacker2020-05-12 22:21:04
PHP
Asjacker, 2020-05-12 22:21:04

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

2 answer(s)
E
Eugene Sherman, 2020-05-12
@freehostua

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.

G
galaxy, 2020-05-12
@galaxy

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 question

Ask a Question

731 491 924 answers to any question