Thanks to visit codestin.com
Credit goes to github.com

Skip to content

close a session #7936

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
binh-vu opened this issue May 5, 2013 · 1 comment
Closed

close a session #7936

binh-vu opened this issue May 5, 2013 · 1 comment

Comments

@binh-vu
Copy link

binh-vu commented May 5, 2013

I have discovered that when I call session->start() method of Session Object, I can't close it properly, i.e method isStarted will always return true after I called session->start().

I checked Session & NativeSessionStorage in HttpFoundation folder and find out no methods set started property of storage to be false, that why isStarted always return true.

Where am I wrong?

I'm using symfony 2.2, thank you.

@Tobion
Copy link
Contributor

Tobion commented Nov 1, 2013

Fixed by #9246

@Tobion Tobion closed this as completed Nov 1, 2013
fabpot added a commit that referenced this issue Nov 28, 2013
…ession was closed (Taluu)

This PR was merged into the 2.2 branch.

Discussion
----------

[HttpFoundation] Do not return an empty session id if the session was closed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7936
| License       | MIT
| Doc PR        | ~

A regression from the bug fix #9246 was introduced due to an incomplete fix ;

As the `started` flag on the NativeSessionStorage was not `true` anymore when saving the session, the session id was always empty when saving it, and thus when sending the `PHPSESSID` cookie.

The previous PR I made (#9530) was another approach to solve this regression, but this one should keep the fix made by @tecbot on #9246, and finish it with another verification. I may miss another place where `started` is used, but I don't really see which other conditions depending on this property should be altered...

**Note : this is #9611 rebased on 2.2**

This should be mergeable.

Commits
-------

5b9a727 When getting the session's id, check if the session is not closed
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