Skip to content

Loosing session data in test environment if session is not used in request #6225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maryo opened this issue Dec 7, 2012 · 1 comment
Closed
Milestone

Comments

@maryo
Copy link
Contributor

maryo commented Dec 7, 2012

If MockFileSessionStorage is used and session data are not used (session is not started). Session data are replaced with an empty array.

For example if user is logged in (authentication token is present in the session) and user goes to a non-existenting page, then the session ID is set from cookies (see TestSessionListener#onKernelRequest) but the session is not started. Then after NotFoundHttpException is thrown, TestSessionListener#onKernelResponse calls Session#save and replaces the session data with an empty array.

In common situations it works becase the session is started when something reads the data from the session. See MockArraySessionStorage#getBag.

I think there should be some condition if the session is started before it saves it.

@fabpot
Copy link
Member

fabpot commented Dec 15, 2012

fixed by #6362

@fabpot fabpot closed this as completed Dec 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants