-
Notifications
You must be signed in to change notification settings - Fork 327
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
LockKey doesn't get prefixed with prefix properly + patch #249
Comments
Yes I believe it does. |
@hoshsadiq given that we released 3.0.0-RC2 and gearing towards 3.0.0 I think we should consider pushing this fix in there still. If you want to make the PR you'd only need to target |
Makes sense. |
What do yout think @dkarlovi? |
If you're asking about
Sounds good to me, the handler there should work just as well. Ironically, I'm not using it even though I wrote it since this bundle provides direct access to the Redis client which I needed explicitly so switched the session handler too. :) If some issues come up, I pledge to fix them in Symfony. So, from me, 👍 |
Thanks a lot @dkarlovi! I am now wondering what's the difference between ours and the one you implemented in Symfony. It looks like it's all about the lock behavior for write and read but I don't get why it's needed. Could be to mitigate some security issue? |
Session locks were added later IIRC, by @nicolas-grekas, it's a feature for all Symfony's session handlers, don't know the specifics. Overall, the handler from Symfony is trivial, but works and is used: some people already fixed a few small bugs since it was added. You should be pretty safe to use it, IMO. |
It looks like session locking was not implemented yet. See symfony/symfony#4976. |
I think it's pretty pointless to do it on our end while it should be pretty much Symfony native behavior. |
@curry684 Yes, what do you think about contributing a lock logic to the Symfony RedisSessionHandler? |
Sounds like a lot of work :D But yeah I think we should eventually do it as it's likely the most used non-file session handler in Symfony. |
Is fixed in 3.0. |
The
RedisSessionHandler::$lockKey
gets prefixed with just the prefix without the colon ($this->prefix.$lockKey
), but every other session related sessions get prefixed with$this->prefix.':'.$sessionId
). Lock key should also have a colon after the prefix ($this->prefix.':'.$this->lockKey
). I've generated a patch to fix this. I'd give you a PR but I'm not sure where to point the PR to. You can apply this by saving it asdiff.patch
and running:patch -p0 < diff.patch
.This was asked about in #181 as well. There's already a PR to master #158 but this is for 1.1.
Below is the patch:
The text was updated successfully, but these errors were encountered: