From 417733191511d32c5169ac90a1e4da964667809c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 1 May 2019 10:04:33 +0200 Subject: [PATCH] Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" This reverts commit 029fb2e7e36b7cdf29e27d4bfa54dd11adc5d457, reversing changes made to 9dad29d61c5605b589493efe34012fdb1218b92b. --- .../FrameworkBundle/Resources/config/session.xml | 1 - src/Symfony/Bundle/FrameworkBundle/composer.json | 2 +- .../Component/HttpFoundation/Session/Session.php | 4 +--- .../HttpFoundation/Tests/Session/SessionTest.php | 10 ---------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml index c87f688c78..8b68d9e846 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml @@ -15,7 +15,6 @@ - diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index e5449ff32e..78d7ae1e56 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -23,7 +23,7 @@ "symfony/dependency-injection": "^3.4.24|^4.2.5", "symfony/config": "~3.4|~4.0", "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/http-foundation": "^3.4.24|^4.2.5", + "symfony/http-foundation": "^3.3.11|~4.0", "symfony/http-kernel": "~3.4|~4.0", "symfony/polyfill-mbstring": "~1.0", "symfony/filesystem": "~2.8|~3.0|~4.0", diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index 62ce948b68..867ceba97f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -193,9 +193,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable */ public function save() { - if ($this->isStarted()) { - $this->storage->save(); - } + $this->storage->save(); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php index e75b3321b0..afa00fc7c3 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php @@ -260,14 +260,4 @@ class SessionTest extends TestCase $flash->get('hello'); $this->assertTrue($this->session->isEmpty()); } - - public function testSaveIfNotStarted() - { - $storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface')->getMock(); - $session = new Session($storage); - - $storage->expects($this->once())->method('isStarted')->willReturn(false); - $storage->expects($this->never())->method('save'); - $session->save(); - } }