Skip to content

Commit 9041637

Browse files
committed
bug symfony#31338 Revert "bug symfony#30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- Revert "bug symfony#30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This reverts commit 029fb2e, reversing changes made to 9dad29d. Reverts symfony#30620 Replaces symfony#31215 We don't need to solve this in 3.4 Making the session resettable should be done on master, by implementing `ResetInterface`. On 3.4 apps, one should write a dedicated `SessionResetter` that would implement the reverted logic. Commits ------- 4177331 Revert "bug symfony#30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
2 parents e0b5fb2 + 4177331 commit 9041637

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<argument type="service" id="session.storage" />
1616
<argument type="service" id="session.attribute_bag" />
1717
<argument type="service" id="session.flash_bag" />
18-
<tag name="kernel.reset" method="save" />
1918
</service>
2019

2120
<service id="Symfony\Component\HttpFoundation\Session\SessionInterface" alias="session" />

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/dependency-injection": "^3.4.24|^4.2.5",
2424
"symfony/config": "~3.4|~4.0",
2525
"symfony/event-dispatcher": "~3.4|~4.0",
26-
"symfony/http-foundation": "^3.4.24|^4.2.5",
26+
"symfony/http-foundation": "^3.3.11|~4.0",
2727
"symfony/http-kernel": "~3.4|~4.0",
2828
"symfony/polyfill-mbstring": "~1.0",
2929
"symfony/filesystem": "~2.8|~3.0|~4.0",

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ public function migrate($destroy = false, $lifetime = null)
193193
*/
194194
public function save()
195195
{
196-
if ($this->isStarted()) {
197-
$this->storage->save();
198-
}
196+
$this->storage->save();
199197
}
200198

201199
/**

src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,4 @@ public function testIsEmpty()
260260
$flash->get('hello');
261261
$this->assertTrue($this->session->isEmpty());
262262
}
263-
264-
public function testSaveIfNotStarted()
265-
{
266-
$storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface')->getMock();
267-
$session = new Session($storage);
268-
269-
$storage->expects($this->once())->method('isStarted')->willReturn(false);
270-
$storage->expects($this->never())->method('save');
271-
$session->save();
272-
}
273263
}

0 commit comments

Comments
 (0)