How to clear session of all users?

I use php sessions in my project, updated code: added some values ​​to session.now I need to clear all existing sessions

ps.my OS - ubuntu 9.04

+3
source share
2 answers

By default, PHP session information is stored in files under / tmp /. Usually file names begin with sess_. Therefore, deleting these files will delete existing sessions. Perhaps the php.ini file has been modified to change the location of these files, so check it if you cannot find the files you need.

+8
source

If a file has been added / needed in all your files, you can place the migration logic there.

if (unset($_SESSION['myvar']) {
  $_SESSION['myvar'] = my_setup_myvar_func();
}

PHP , YMMV.

+1

Source: https://habr.com/ru/post/1734033/


All Articles