Skip to content

Commit

Permalink
bug #9985 Prevent WDT from creating a session (mvrhov)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Prevent WDT from creating a session

The wdt should not create a session.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
Todo: -
License of the code: MIT
Documentation PR: N/A

Commits
-------

4791351 Prevent WDT from creating a session
  • Loading branch information
fabpot committed Jan 13, 2014
2 parents d4a3254 + 4791351 commit 704f982
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -227,7 +227,7 @@ public function toolbarAction(Request $request, $token)

$session = $request->getSession();

if (null !== $session && $session->getFlashBag() instanceof AutoExpireFlashBag) {
if (null !== $session && $session->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag) {
// keep current flashes for one more request if using AutoExpireFlashBag
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
}
Expand Down
Expand Up @@ -67,7 +67,7 @@ public function onKernelResponse(FilterResponseEvent $event)

if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) {
$session = $request->getSession();
if ($session && $session->getFlashBag() instanceof AutoExpireFlashBag) {
if (null !== $session && $session->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag) {
// keep current flashes for one more request if using AutoExpireFlashBag
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
}
Expand Down

0 comments on commit 704f982

Please sign in to comment.