<?php
class FileSessionHandler
{
private $savePath;
function open($savePath, $sessionName)
{
return true;
}
function close()
{
return true;
}
function read($id)
{
return 'lol|s:222:"1";lol2|s:1:"1";';
}
function write($id, $data)
{
}
function destroy($id)
{
}
function gc($maxlifetime)
{
}
}
$handler = new FileSessionHandler();
session_set_save_handler(
array($handler, 'open'),
array($handler, 'close'),
array($handler, 'read'),
array($handler, 'write'),
array($handler, 'destroy'),
array($handler, 'gc')
);
register_shutdown_function('session_write_close');
session_start();
var_dump($_SESSION);
preferences:
45.63 ms | 402 KiB | 5 Q