1.php<?php
$savePath = './';
// 保存一天
$lifeTime = 24 * 3600;
session_start();
$_SESSION["admin"]="梦飞";
session_save_path($savePath);
echo $_SESSION["admin"];
?>
$savePath = './';
// 保存一天
$lifeTime = 24 * 3600;
session_start();
$_SESSION["admin"]="梦飞";
session_save_path($savePath);
echo $_SESSION["admin"];
?>
处理方法:
1.找到php.ini配置文件打开.
2.找到session.auto_start=1 把前面的";"掉。
3.找到session.save_path = "C:/Temp" 把前面的";"掉。设置你的保存路径即可。
<?php
$_session["admin"]="梦飞";
echo $_session["admin"];
?>
1.php
<?php
header ("Content-Type:html/text;charset:UTF-8");
session_start();
$_session['admin']="梦飞";
?>
2.php
<?php
header ("Content-Type:html/text;charset:UTF-8");
session_start();
echo $_session['admin'];
?>
支持,估计你没有打开session!
我的是 0
这个好象用法不是这样的手册
session_save_path
(PHP 4, PHP 5)session_save_path -- Get and/or set the current session save path
Description
string session_save_path ( [string path] )
session_save_path() returns the path of the current directory used to save session data. If path is specified, the path to which data is saved will be changed. session_save_path() needs to be called before session_start() for that purpose.
——————————————————————————session_save_path ( [string path] ),用在start前,而且可能当页有效!要用,可能每人页都要用!
再开启session.auto_start=1 试试吧