session_unregister() only make effact in situation when register_global is set On.
That is to say if u use $_SESSION['name'] to get the variable, this function will be useless.
That is to say if u use $_SESSION['name'] to get the variable, this function will be useless.
解决方案 »
- 关于php环境配置问题
- 安装dede出现Deprecated: Function ereg_replace() is deprecated in F:\wamp\www1\dede\c
- php读取XML数据问题
- php发邮件
- 一个关于树型目录sql语句的问题
- [求助] php应该怎样嵌入页面才有效??
- 偷个懒,请问谁有把数字形式的“钱”转换成汉字的大写形式的程序?
- 怎样计算php里的时间差,mysql的时间差?
- php mysql中这种怎么查
- 求助关于Cannot redeclare jiexi() (previously declared in
- --- php中调用MSSQL存储过程的问题 --- 赐教 ---
- 求从MYSQL中导出和导入SQL脚本的方法。一直不会,好痛苦。
那就用session_unregister("aaa");
//test.php
session_start();
session_register('name');
$name="uGain";
echo '<a href=test2.php>test</a>';
?><?
//test2.php
session_start();
session_unregister('name');//value of $name already in the page,session_register() only empty the value of $name in session.
echo $name;
echo '<br><a href=test3.php>test3</a>';
?><?
//test3.php
session_start();
echo $name;
?>
session_unregister()
This function doesn't unset the corresponding global variable for name, it only prevents the variable from being saved as part of the session. You must call unset() to remove the corresponding global variable.