【问题标题】:What is the difference between session_unset and unset($_SESSION) in PHP? [closed]PHP 中的 session_unset 和 unset($_SESSION) 有什么区别? [关闭]
【发布时间】:2015-12-06 22:29:08
【问题描述】:

用 session_unset 和 unset($_SESSION) 取消设置会话变量有什么区别?

这不是一个重复的问题,因为所有其他问题都在谈论 session_unset 和 session_destroy 之间的区别!

【问题讨论】:

  • PHP.net 和/或 Google 上的手册是怎么说的?
  • 他们都在谈论 session_unset 和 session_destroy !
  • Caution Do NOT unset the whole $_SESSION with unset($_SESSION) as this will disable the registering of session variables through the $_SESSION superglobal.

标签: php variables session unset


【解决方案1】:

session_unset() 释放所有会话变量。

不要使用unset($_SESSION) 取消设置整个$_SESSION,因为这将禁用通过$_SESSION 超全局注册会话变量。

来源:http://php.net/manual/en/function.session-unset.php

【讨论】:

    猜你喜欢
    • 2015-06-23
    • 2011-05-17
    • 2014-10-12
    • 2012-05-17
    • 2011-12-27
    • 2010-12-23
    • 1970-01-01
    • 2017-10-03
    • 1970-01-01
    相关资源
    最近更新 更多