开发者

How to clear session of all users?

开发者 https://www.devze.com 2022-12-20 19:46 出处:网络
I using php sessions in my project,i updated cod开发者_开发问答e:added some values to session.now i need to clear all existing sessions

I using php sessions in my project,i updated cod开发者_开发问答e:added some values to session.now i need to clear all existing sessions

ps.my OS is ubuntu 9.04


By default PHP session information is stored in files under /tmp/. The filenames are usually prefixed with sess_. So removing these files would clear out the existing sessions. The php.ini file may have been altered to change the location of these files, so check it if you can't find the right files.


If there were a file included/required in all your files, you could put migration logic in there.

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

My main PHP application has such a file, but YMMV.

0

精彩评论

暂无评论...
验证码 换一张
取 消