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.
解决方案 »
- 关于session_start()的问题
- 紧急求助:foreach语句中的$key可以简写成$k??$value可以简写成$v???
- syntax error, unexpected '=' 错误问题
- 求助
- utf8和utf-8这两个不一样吗??什么时候该用哪个???[php和mysql]
- $HTTP_POST_VARS和$_POST的区别?
- 怎样实现这样的树,要求内详,分不够再加,急!!!!!!!!
- linux环境下PHP加载pcntl 模块失败
- PHP调试的问题
- 数据表有2条以上的记录时第一条会显示第二条记录的内容
- --- 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.