-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] RedisSessionHandler #24433
New issue
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
Comments
please use the search. #14539 |
I did, must have missed it because it's closed which makes no sense to me. Having a user handler means you can define the save path from config, using env vars, as I said. There's zero reason to have TWO Memcached-related handlers and zero Redis handlers. |
There are not two memcached handlers. |
I think you know what I mean: HttpFoundation currently provides support for: Reason given for rejecting previous PRs: there's a native support already. Obviously, this goes for Memcache one too, why did that get special treatment and end up in the framework?
Obviously it's technically enough, this issue is about providing it by the framework, with all the benefits coming from the integration (like the twice-mentioned env config support out of the box). Monolog can output to STDERR, but having a minimal implementation built right into the framework is still desirable. IMO having multiple PRs and issues on the matter should be a signal people use Redis in this way, are keen to use it in Symfony apps and having support for it shouldn't be a problem, especially since the implementation is so minimal. Please reconsider this (several times rejected) idea. |
Two side notes I've just remembered:
|
@xabbuh thanks for the links, I actually fully agree with @nicolas-grekas arguments there about different volatility constraints for both use cases, haven't completely considered it. |
You can just call |
I'm not claiming it's impossible to do it otherwise because of course it is. The proposal is to bring Redis support inline with Memcache support for this use case, as I've said. If I can
for Redis, I can do that for Memcache as well, what's the reason to support Memcached twice, but Redis not at all? Also, as I've said, from my experience Redis native session support can be buggy. What's exactly your reason NOT to do it, which doesn't also apply to Memcached? |
Maintainance costs? Not reinventing the wheel? There are alot of reasons. Feel free to provide a PR that has definite advantages like more features or better performance than the existing redis session handlers. Then we can talk more concrete. |
Does the existing Memcached handler satisfy those requirements, seeing it's just a wrapper around the native module? Memcached native session handler can basically be used exactly like the Redis one. Or are you planning on deprecating |
@nicolas-grekas sure, but I don't see what my PR could do differently than those two rejected before. The way I see, the argument here for not including the Redis adapter is "no, thank you" as I literally cannot understand why would you not do it if you have done the Memcached one:
That's my whole point, can't see why Redis is second-class citizen for Symfony sessions. :) IMO the "use env variables for save path" (esp. with your new env vars processing infra) is reason enough to want to support Redis directly. |
When #24523 will be merged, I think it'll make sense to add a Redis session handler. |
@nicolas-grekas would we go for a new PR or resume previous ones? |
New PR (that could borrow code from previous ones) |
@Simperfit seeing you're doing #23910, I'll do this, yes. |
There we go, hope it's OK. :) |
This PR was merged into the 4.1-dev branch. Discussion ---------- [HttpFoundation] RedisSessionHandler | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24433, #18233, #14539, #4538, #3498 | License | MIT | Doc PR | symfony/symfony-docs#8572 Ability to use Redis as a session storage backend. Discussed in detail in linked issues / PRs. Commits ------- 8776cce [HttpFoundation] Add RedisSessionHandler
Add a
RedisSessionHandler
, same as existing ones for Memcache(d). It would allow to use Redis as a session storage without modifying php.ini and with better integration with Symfony (using env vars for configuring thesave_path
, for example).The text was updated successfully, but these errors were encountered: