mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-18 04:48:39 +00:00
Fix session lock
Still needs improvment. Shouldn't be static!
This commit is contained in:
parent
baeb32b51e
commit
7b36dafa57
|
|
@ -85,8 +85,6 @@ class HttpSession implements SessionInterface
|
|||
|
||||
$this->sid = session_id();
|
||||
$this->setCsrfProtection();
|
||||
|
||||
self::$isLocked = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -135,7 +133,7 @@ class HttpSession implements SessionInterface
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function lock()
|
||||
public function lock()
|
||||
{
|
||||
self::$isLocked = true;
|
||||
}
|
||||
|
|
@ -158,7 +156,10 @@ class HttpSession implements SessionInterface
|
|||
*/
|
||||
public function save()
|
||||
{
|
||||
|
||||
if(!self::$isLocked) {
|
||||
$_SESSION = $this->sessionData;
|
||||
session_write_close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -199,10 +200,7 @@ class HttpSession implements SessionInterface
|
|||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
if(!self::$isLocked) {
|
||||
$_SESSION = $this->sessionData;
|
||||
session_write_close();
|
||||
}
|
||||
$this->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,7 @@ abstract class HeaderAbstract
|
|||
*/
|
||||
public static function lock()
|
||||
{
|
||||
CookieJar::lock();
|
||||
HttpSession::lock();
|
||||
// todo: maybe pass session as member and make lock not static
|
||||
self::$isLocked = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user