Skip to content

Commit 9fa6514

Browse files
committed
1 parent 2d80935 commit 9fa6514

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: Slim/Middleware/SessionCookie.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function loadSession()
124124

125125
if ($value) {
126126
try {
127-
$_SESSION = unserialize($value);
127+
$_SESSION = json_decode($value, true);
128128
} catch (\Exception $e) {
129129
$this->app->getLog()->error('Error unserializing session cookie value! ' . $e->getMessage());
130130
}
@@ -138,7 +138,7 @@ protected function loadSession()
138138
*/
139139
protected function saveSession()
140140
{
141-
$value = serialize($_SESSION);
141+
$value = json_encode($_SESSION);
142142

143143
if (strlen($value) > 4096) {
144144
$this->app->getLog()->error('WARNING! Slim\Middleware\SessionCookie data size is larger than 4KB. Content save failed.');

0 commit comments

Comments
 (0)