8000 Adding PSR6 session handler by Nyholm · Pull Request #23321 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Adding PSR6 session handler #23321

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
wants to merge 7 commits into from
Closed

Adding PSR6 session handler #23321

wants to merge 7 commits into from

Conversation

Nyholm
Copy link
Member
@Nyholm Nyholm commented Jun 28, 2017
Q A
Branch? 3.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR On the way

It is very common that you store your session in Memcached or Redis. But instead of creating a RedisHandler we should be more abstract and go with a PSR6 handler. That will give the flexibility to use any storage.

This PR could deprecate the Memcached, Memcache, MongoDB handlers.. But I left that decision to a separate PR.

@stof
Copy link
Member
stof commented Jun 28, 2017

New features should not go in master but in 3.4.

I'm not sure about this one. Non-locking session handlers generally cause WTF issues (people wondering why their session disappear when doing AJAX requests). Do we actually want to add one more ?

@Nyholm Nyholm changed the base branch from master to 3.4 June 28, 2017 15:32
@Nyholm
Copy link
Member Author
Nyholm commented Jun 28, 2017

New features should not go in master but in 3.4.

Thank you. I've updated this.

Do we actually want to add one more ?

What do you propose? This handler suffers from the same issues as existing ones.

@xabbuh
Copy link
Member
xabbuh commented Jun 29, 2017

I proposed this in the past and @nicolas-grekas gave some good arguments on why this may not be the best idea (see #19193 (comment)).

@Nyholm
Copy link
Member Author
Nyholm commented Jun 29, 2017

I guess I should have made a better search before I wrote this PR.

I know a cache is not a data store and I know that PSR-6 is for caching and a SessionHandler needs a data store. But using the abstraction over different storages that PSR-6 provide is excellent. Then we can leave it for the user to not use the ArrayCache for sessions.

As an alternative to this Handler, we should use Memcache, Memcached, Redis, Predis, (MongoDB, Pdo etc) etc. The end result would be the same. We would still use a cache storage but without the PSR6 abstraction.

@nicolas-grekas
Copy link
Member

👎 for the same reasons as previously. Although technically PSR6 may fit the very simple case, it's a dead end in terms of feature for the session domain. No locking, and no possibility for more advanced sessions related features.

@Nyholm
Copy link
Member Author
Nyholm commented Jul 3, 2017

no possibility for more advanced sessions related features.

That makes the difference for me. I'll look into if we can do anything good with the session. Because I really think there should be core support for storing sessions in Memcache and Redis.

Thank you for the reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0