Reputation: 57
I tried to destroy my 'session'
, but it seems session is accessible Properly after that destruction. even I checked it by 'isActive' and got a response:
'false'
but it's still readable and writable yet.
$session=Yii::$app->session;
$session->close();
$session->destroy();
$session->isActive ? $m='ya' : $m='no';
echo $m; // responded 'false'
$_SESSION['test']=1; //session is accessible properly yet
echo $_SESSION['test']; // session response 1
Upvotes: 1
Views: 54
Reputation: 133410
$_SESSION
is a PHP
global var
PHP:SESSION-DOCS
An associative array containing session variables available to the current script. See the Session functions documentation for more information on how this is used.
This means that $_SESSION
is always active .. destroy()
should "destroy" the actual content of the $_SESSION
http://www.yiiframework.com/doc-2.0/yii-web-session.html
http://www.yiiframework.com/doc-2.0/yii-web-session.html#destroy()-detail
destroy()
In detail Frees all session variables and destroys all data registered to a session.
Upvotes: 2