首頁 >後端開發 >php教程 >PHP筆記------關於Session操作

PHP筆記------關於Session操作

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-08-08 09:27:411122瀏覽

1.判斷Session是否賦值

if(!isset($_SESSION['username']) || $_SESSION['username']==''){
$-this>-redirect(' Login/login');
}

2.退出清除Session

$_SESSION=array();

$_SESSION=array(); setcookie(session_name(),'',time()-1,'/');
}
session_destroy();
$this->redirect('Index/index'
$this->redirect('Index/index'
$this->redirect('Index/index'

$this->redirect('Index/index'

以上就介紹了PHP筆記------關於Session操作,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。

🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn