Skip to content
Snippets Groups Projects
Unverified Commit cb125481 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst Committed by GitHub
Browse files

Merge pull request #863 from smotornyuk/update-session-params-before-session-start

Make sure that session is closed and only then update cookie params
parents 5eecf012 2a37a278
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