Skip to content
Snippets Groups Projects
Commit 2a37a278 authored by Sergey Motornyuk's avatar Sergey Motornyuk
Browse files

Make sure that session is closed and only then update cookie params

parent 3b0edcee
No related branches found
No related tags found
No related merge requests found
...@@ -343,6 +343,11 @@ class SessionHandlerPHP extends SessionHandler ...@@ -343,6 +343,11 @@ class SessionHandlerPHP extends SessionHandler
); );
} }
if (session_id() !== '') {
// session already started, close it
session_write_close();
}
session_set_cookie_params( session_set_cookie_params(
$cookieParams['lifetime'], $cookieParams['lifetime'],
$cookieParams['path'], $cookieParams['path'],
...@@ -351,11 +356,6 @@ class SessionHandlerPHP extends SessionHandler ...@@ -351,11 +356,6 @@ class SessionHandlerPHP extends SessionHandler
$cookieParams['httponly'] $cookieParams['httponly']
); );
if (session_id() !== '') {
// session already started, close it
session_write_close();
}
session_id($sessionID); session_id($sessionID);
$this->sessionStart(); $this->sessionStart();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment