We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d80935 commit 9fa6514Copy full SHA for 9fa6514
Slim/Middleware/SessionCookie.php
@@ -124,7 +124,7 @@ protected function loadSession()
124
125
if ($value) {
126
try {
127
- $_SESSION = unserialize($value);
+ $_SESSION = json_decode($value, true);
128
} catch (\Exception $e) {
129
$this->app->getLog()->error('Error unserializing session cookie value! ' . $e->getMessage());
130
}
@@ -138,7 +138,7 @@ protected function loadSession()
138
*/
139
protected function saveSession()
140
{
141
- $value = serialize($_SESSION);
+ $value = json_encode($_SESSION);
142
143
if (strlen($value) > 4096) {
144
$this->app->getLog()->error('WARNING! Slim\Middleware\SessionCookie data size is larger than 4KB. Content save failed.');
0 commit comments