亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

php中session_destroy()的作用?

php中session_destroy()的作用?

幕布斯7119047 2019-02-05 10:06:17
session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie. To use the session variables again, session_start() has to be called. 它會destroys all of the data associated with the current session,但是它既不注銷變量,又不注銷session cookie。那它做了什么?還有這個函數有什么用呢?
查看完整描述

2 回答

?
MM們

TA貢獻1886條經驗 獲得超2個贊

終結 Session
如果您希望刪除某些 session 數據,可以使用 unset() 或 session_destroy() 函數。

unset() 函數用于釋放指定的 session 變量:

<?php
unset($_SESSION['views']);
?>
您也可以通過 session_destroy() 函數徹底終結 session:

<?php
session_destroy();
?>
注釋:session_destroy() 將重置 session,您將失去所有已存儲的 session 數據。



查看完整回答
反對 回復 2019-03-16
  • 2 回答
  • 0 關注
  • 1536 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號