session_start(); $_SESSION['test'] = 'test'; session_write_close(); //do something
function open($savePath, $sessionName)
{
echo 'open is called';
return true;
}
function close()
{
echo 'close is called';
return true;
}
function read($sessionId)
{
echo 'read is called';
return '';
}
function write($sessionId, $data)
{
echo 'write is called';
return true;
}
function destroy($sessionId)
{
echo 'destroy is called';
return true;
}
function gc($lifetime)
{
echo 'gc is called';
return true;
}
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
register_shutdown_function ( 'session_write_close' );
session_start();
$_SESSION['foo'] = "bar";
class MySessionHandler extends SessionHandler {
public function __construct()
{
}
public function open($save_path, $session_id)
{
}
public function close()
{
}
public function create_sid()
{
}
public function read($id)
{
}
public function write($id, $data)
{
}
public function destroy($id)
{
}
}
$handler = new MySessionHandler();
//第2个参数将函数 session_write_close() 注册为 register_shutdown_function() 函数。
session_set_save_handler($handler, true);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有