ezsystems/ezpublish-legacy — pull request #914 by lolautruche (2014-03-21 18:19:45+00:00)
Title: Fix EZP-22414: Session is lost when redirecting from a legacy module

https://jira.ez.no/browse/EZP-22414

**This only occurs when using Symfony stack, with legacy fallback**.

## Description

In a legacy module, when you set a session variable and then perform a redirection (e.g. using `$Module->redirectTo( '/' )`) to a page managed by Symfony stack, created session will be lost during the redirection process.

There were 2 issues:
* Redirection process was still *brutal*, with an `eZExecution::cleanExit()`, preventing Symfony to correctly handle the redirect response, with the appropriate `Set-Cookie` header.
* Since we got lazy sessions back, when the session needed to be started from legacy, it just didn't happen, and we lost the newly created session variable.

> Note: It seems that `PreAuthenticatedToken` we used before merging full Symfony authentication has been fixed regarding systematic session start. Hence this patch would also help for 5.2 installation.

## Tests
Manual tests, both through Symfony stack and pure legacy stack