Created
September 19, 2014 17:03
-
-
Save derekaug/2982efd334af016f0f94 to your computer and use it in GitHub Desktop.
Ends all active sessions on a site if using default PHP session handler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = session_save_path(); | |
if ($handle = opendir($path)) { | |
while (false !== ($entry = readdir($handle))) { | |
if('sess' == substr($entry, 0, 4)){ | |
$file = $path . '/' . $entry; | |
unlink($file); | |
} | |
} | |
closedir($handle); | |
} | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment