Created
December 10, 2016 17:43
-
-
Save cronoh/267ff2f2e019cf0ed258ab909c8bcc49 to your computer and use it in GitHub Desktop.
Laravel 5.x Native 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 | |
namespace App\Extensions; | |
use SessionHandlerInterface; | |
class NativeSessionHandler implements SessionHandlerInterface | |
{ | |
public function open($savePath, $sessionName) | |
{ | |
} | |
public function close() | |
{ | |
} | |
public function read($sessionId) | |
{ | |
return serialize(isset($_SESSION) ? $_SESSION : null); | |
} | |
public function write($sessionId, $data) | |
{ | |
$_SESSION = unserialize($data); | |
} | |
public function destroy($sessionId) | |
{ | |
} | |
public function gc($lifetime) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment