-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] MongoDbSessionHandler does not support disabling of gc operations #11508
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
Comments
Yes I think it makes sense. But I would prefer http://docs.mongodb.org/manual/tutorial/expire-data/#expire-documents-at-a-certain-clock-time to be able to use different expire times per session. Also remember, that you can already disable gc via php by setting the probability to zero. So actually this is already possible. |
Thanks @Tobion , good point about gc probability. How would you see using the clock time expiry work here with an app level configured session handler? |
Also, as the time field is the last updated time, (which we don't want to lose), using the clock time expiry would need an additional property being added for an expires at time. |
In write you can do |
Won't that be a BC break? As expiry would be moving from a configuration option of the framework/component, to a php.ini option? |
You can add an option to the handler. When active we use mongo ttl with expireAt field. When not active we use php gc and just the update time field (as now). |
OK thanks, will work on that. |
The framework config option is just a wrapper around ini_set AFAIK. And people can still manually call ini_set whenever they want (e.g. different per session). |
…xpiry via configurable expiry_field (catchamonkey) This PR was squashed before being merged into the 2.3 branch (closes #11510). Discussion ---------- [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11508 | License | MIT | Doc PR | no ToDo * [x] Fix Tests Looking for feedback on this early PR. This adds a config option that disables the PHP GC method call from doing anything, It also means that the write method sets up the auto expiring index. Ref: #11508 Commits ------- b56b740 [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field
…xpiry via configurable expiry_field (catchamonkey) This PR was merged into the 2.6-dev branch. Discussion ---------- [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11508 | License | MIT | Doc PR | no This PR applies #11510 to master instead of 2.3 Should be merged on master: - [x] after #11667 is merged to 2.3 - [x] and after 2.3 is merged back to master Commits ------- beca900 [HttpFoundation] MongoDbSessionHandler supports auto expiry via configurable expiry_field
Hi,
I've implemented the MongoDbSessionHandler, am also using a Mongo index with expireAfterSeconds to expire the session after a set amount of inactivity.
However even with this set, the gc method still performs a delete operation of it's own.
Have thought about adding an option to the Session Handler to disable that method from doing anything, and also having the write method add the expires index.
Does that sound OK? Happy to code it and send a PR.
Thanks.
The text was updated successfully, but these errors were encountered: