Skip to content

Commit

Permalink
Implement destroy() for builtin session handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jul 19, 2018
1 parent 290623d commit 72552be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Horde/SessionHandler/Storage/Builtin.php
Expand Up @@ -65,6 +65,20 @@ public function write($id, $session_data)
*/
public function destroy($id)
{
try {
$di = new DirectoryIterator($this->_path);
} catch (UnexpectedValueException $e) {
return false;
}

foreach ($di as $val) {
/* Make sure we're dealing with files that start with sess_. */
if ($val->isFile() &&
($val->getFilename() == 'sess_' . $id)) {
return unlink($val->getPathname());
}
}

return false;
}

Expand Down

0 comments on commit 72552be

Please sign in to comment.