views:

41

answers:

2

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

ps.my OS is ubuntu 9.04

+4  A: 

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.

ar
This gets my upvote because it leaves the rest of the server untouched: you don't reboot the service unless you actually have to.
Frank Shearar
See the manual for session.save_path: http://php.net/manual/en/session.configuration.php#ini.session.save-path
janmoesen
What if you store the session information in database?
Pentium10
+1  A: 

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.

Frank Shearar