mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 14:08:40 +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->sid = session_id();
|
||||||
$this->setCsrfProtection();
|
$this->setCsrfProtection();
|
||||||
|
|
||||||
self::$isLocked = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -135,7 +133,7 @@ class HttpSession implements SessionInterface
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public static function lock()
|
public function lock()
|
||||||
{
|
{
|
||||||
self::$isLocked = true;
|
self::$isLocked = true;
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +156,10 @@ class HttpSession implements SessionInterface
|
||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
|
if(!self::$isLocked) {
|
||||||
|
$_SESSION = $this->sessionData;
|
||||||
|
session_write_close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -199,10 +200,7 @@ class HttpSession implements SessionInterface
|
||||||
*/
|
*/
|
||||||
public function __destruct()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
if(!self::$isLocked) {
|
$this->save();
|
||||||
$_SESSION = $this->sessionData;
|
|
||||||
session_write_close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,7 @@ abstract class HeaderAbstract
|
||||||
*/
|
*/
|
||||||
public static function lock()
|
public static function lock()
|
||||||
{
|
{
|
||||||
CookieJar::lock();
|
// todo: maybe pass session as member and make lock not static
|
||||||
HttpSession::lock();
|
|
||||||
self::$isLocked = true;
|
self::$isLocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user