Add support for empty session write
- Ignored empty data left session intact, leading to unexpected behaviors
This commit is contained in:
parent
b3dcecf987
commit
bc02ad89d0
2 changed files with 2 additions and 2 deletions
|
@ -87,7 +87,7 @@ class Cache implements SessionHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$session_data) {
|
if (!$session_data) {
|
||||||
return true;
|
return $this->destroy($session_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->cache->set('session:' . $session_id, $session_data, Session::$expire);
|
return $this->cache->set('session:' . $session_id, $session_data, Session::$expire);
|
||||||
|
|
|
@ -94,7 +94,7 @@ class Database implements SessionHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$session_data) {
|
if (!$session_data) {
|
||||||
return true;
|
return $this->destroy($session_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$expire = time() + Session::$expire;
|
$expire = time() + Session::$expire;
|
||||||
|
|
Loading…
Reference in a new issue