Php - destroy all sessions

Possible duplicate:
Is this the right way to destroy all sessions in php?

Hey guys,

what's the best way to destroy all sessions (and not just one from the current user).

Thanks in advance!

+5
source share
1 answer

It depends on how your sessions are stored. If they are in the database, just delete them. If they are on the file system somewhere, like in / tmp, just delete them. For session information in PHP, see the manual. http://www.php.net/manual/en/book.session.php

session_save_path(), , , memcached, mysql . PHP . ,

Shell: rm -rf /var/lib/php/session
PHP: shell_exec('rm -rf '.session_save_path() );
+13

All Articles