Skip to content
Snippets Groups Projects
Commit 046d749f authored by catch's avatar catch
Browse files

Issue #3045349 by alexpott, mikelutz, geerlingguy, catch, mglaman, larowlan:...

Issue #3045349 by alexpott, mikelutz, geerlingguy, catch, mglaman, larowlan: Lazy started sessions with session data are not saved with symfony/http-foundation 3.4.24
parent 33bd9208
No related branches found
No related tags found
No related merge requests found
...@@ -1874,16 +1874,16 @@ ...@@ -1874,16 +1874,16 @@
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v3.4.26", "version": "v3.4.27",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "90454ad44c95d75faf3507d56388056001b74baf" "reference": "fa02215233be8de1c2b44617088192f9e8db3512"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/90454ad44c95d75faf3507d56388056001b74baf", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fa02215233be8de1c2b44617088192f9e8db3512",
"reference": "90454ad44c95d75faf3507d56388056001b74baf", "reference": "fa02215233be8de1c2b44617088192f9e8db3512",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1924,7 +1924,7 @@ ...@@ -1924,7 +1924,7 @@
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-04-17T14:51:18+00:00" "time": "2019-05-01T08:04:33+00:00"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"symfony/console": "~3.4.0", "symfony/console": "~3.4.0",
"symfony/dependency-injection": "~3.4.26", "symfony/dependency-injection": "~3.4.26",
"symfony/event-dispatcher": "~3.4.0", "symfony/event-dispatcher": "~3.4.0",
"symfony/http-foundation": "~3.4.26", "symfony/http-foundation": "~3.4.27",
"symfony/http-kernel": "~3.4.14", "symfony/http-kernel": "~3.4.14",
"symfony/routing": "~3.4.0", "symfony/routing": "~3.4.0",
"symfony/serializer": "~3.4.0", "symfony/serializer": "~3.4.0",
......
...@@ -216,9 +216,7 @@ public function regenerate($destroy = FALSE, $lifetime = NULL) { ...@@ -216,9 +216,7 @@ public function regenerate($destroy = FALSE, $lifetime = NULL) {
throw new \InvalidArgumentException('The optional parameters $destroy and $lifetime of SessionManager::regenerate() are not supported currently'); throw new \InvalidArgumentException('The optional parameters $destroy and $lifetime of SessionManager::regenerate() are not supported currently');
} }
// Only migrate the session if the session is really started and not only if ($this->isStarted()) {
// lazy started.
if ($this->started) {
$old_session_id = $this->getId(); $old_session_id = $this->getId();
// Save and close the old session. Call the parent method to avoid issue // Save and close the old session. Call the parent method to avoid issue
// with session destruction due to the session being considered obsolete. // with session destruction due to the session being considered obsolete.
...@@ -342,19 +340,4 @@ protected function migrateStoredSession($old_session_id) { ...@@ -342,19 +340,4 @@ protected function migrateStoredSession($old_session_id) {
->execute(); ->execute();
} }
/**
* Checks if the session is started.
*
* Beginning with symfony/http-foundation 3.4.24, the session will no longer
* save unless this method returns true. The parent method returns true if
* $this->started is true, but we need the session to also save if we lazy
* started, so we override isStarted() here.
*
* @return bool
* True if started, false otherwise
*/
public function isStarted() {
return parent::isStarted() || $this->startedLazy;
}
} }
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