mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Moving session save into the destructor. Save not possible after sending headers
This commit is contained in:
parent
95a390f701
commit
1914939094
|
|
@ -62,7 +62,7 @@ class HttpSession implements SessionInterface
|
|||
$_SESSION = null;
|
||||
|
||||
$this->sid = session_id();
|
||||
session_write_close();
|
||||
$this->set('UID', 0, false);
|
||||
|
||||
if(($CSRF = $this->get('CSRF')) === null) {
|
||||
$CSRF = StringUtils::generateString(10, 16);
|
||||
|
|
@ -99,10 +99,7 @@ class HttpSession implements SessionInterface
|
|||
*/
|
||||
public function save()
|
||||
{
|
||||
session_id($this->sid);
|
||||
session_start();
|
||||
$_SESSION = $this->sessionData;
|
||||
session_write_close();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -135,4 +132,10 @@ class HttpSession implements SessionInterface
|
|||
$this->sid = $sid;
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$_SESSION = $this->sessionData;
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user