dev-develop
dev-developSession save handler used to store the session in a cookie
MIT
The Requires
- php >=5.3
The Development Requires
by James Moran
Session save handler used to store the session in a cookie
"minimum-stability": "dev", "require": { "locosoftworks/php-cookie-session": "dev-master" }
$handler = new Loco\Session\SaveHandler\ClientSession();
It is recommended that you encrypt the session. Create a class that implements Loco\Crypt\CipherInterface
and inject it into the session handler, (*1)
$handler->setCipher($myEncryptionClass);
Set the session save handler using session_set_save_handler()
(see php documentation), (*2)
session_set_save_handler( array($handler, 'open'), array($handler, 'close'), array($handler, 'read'), array($handler, 'write'), array($handler, 'destroy'), array($handler, 'gc') ); session_start();
You MUST call session_write_close
BEFORE returning any output. Output Buffering is recommended., (*3)
Session save handler used to store the session in a cookie
MIT