Start session automatically if an addon uses the session and exits

This commit is contained in:
Kijin Sung 2015-07-12 20:12:28 +09:00
parent 90c014678a
commit 237f731e02
2 changed files with 4 additions and 1 deletions

View file

@ -361,6 +361,7 @@ class Context
{
$this->isSessionStarted = FALSE;
$this->setCacheControl(-1, true);
register_shutdown_function(array($this, 'checkSessionStatus'));
$_SESSION = array();
}
@ -459,7 +460,7 @@ class Context
{
return;
}
if(count($_SESSION))
if(count($_SESSION) && !headers_sent())
{
$tempSession = $_SESSION;
session_start();