diff --git a/src/Slim/Middleware/Session.php b/src/Slim/Middleware/Session.php index ad1b384..66b7f9a 100644 --- a/src/Slim/Middleware/Session.php +++ b/src/Slim/Middleware/Session.php @@ -88,7 +88,9 @@ protected function startSession() $settings['httponly'] ); - if (session_id()) { + $active = session_status() === PHP_SESSION_ACTIVE; + + if ($active) { if ($settings['autorefresh'] && isset($_COOKIE[$name])) { setcookie( $name, @@ -104,6 +106,8 @@ protected function startSession() session_name($name); session_cache_limiter(false); - session_start(); + if (!$active) { + session_start(); + } } }