- session_set_save_handler: documentation ( source)
- session_start: documentation ( source)
<?php
class MySessionStorage implements SessionHandlerInterface
{
private $path;
function open($savePath, $sessionName)
{
$this->path = $savePath;
}
function close()
{
}
function read($id)
{
return '';
}
function write($id, $data)
{
return TRUE;
}
function destroy($id)
{
return TRUE;
}
function gc($maxlifetime)
{
return TRUE;
}
}
if (session_set_save_handler(new MySessionStorage)){
$toto = session_start();
}