Created
October 2, 2019 23:18
-
-
Save bshaffer/31d6e1c9efc369a27fa5bf7be61e9f4c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
class NullSessionHandler implements SessionHandlerInterface | |
{ | |
public function open($savePath, $sessionName) | |
{ | |
return true; | |
} | |
public function close() | |
{ | |
return true; | |
} | |
public function read($sessionId) | |
{ | |
return ''; | |
} | |
public function write($sessionId, $data) | |
{ | |
return true; | |
} | |
public function destroy($sessionId) | |
{ | |
return true; | |
} | |
public function gc($lifetime) | |
{ | |
return 1; | |
} | |
} | |
$handler = new NullSessionHandler(); | |
session_set_save_handler($handler, true); | |
session_start(); | |
$result = session_gc(); | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment