经测试代码如下:
header('Content-Type: text/html; charset=utf-8');
@session_set_cookie_params(3600,"/","onestopweb.iteye.com",false,TRUE);
//启动新会话或者重用现有会话
session_start();
//配置 Seeeion
$_SESSION['data'] = array('user'=>'chaoyi','website'=>'onestopweb.iteye.com');
//使用 Session
var_dump($_SESSION['data']);
echo '<br>SESSION ID:'.session_id();
//session_destroy();
/*** 来自:编程之家 jb51.cc(jb51.cc) ***/
?>
aaa/demo.PHP经测试代码如下:
header('Content-Type: text/html; charset=utf-8');
@session_set_cookie_params(3600,TRUE);
//启动新会话或者重用现有会话
session_start();
//使用 Session
var_dump($_SESSION['data']);
echo '<br>SESSION ID:'.session_id();
/*** 来自:编程之家 jb51.cc(jb51.cc) ***/
?>
原文链接:https://www.f2er.com/php/529230.html