-
Notifications
You must be signed in to change notification settings - Fork 2k
refactor: Session library #9831
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
base: 4.7
Are you sure you want to change the base?
Conversation
michalsn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
If you're referring to manually removing old session data, then yes. If you're referring to the PHP session GC mechanism, then no.
-
That is clearly a mistake. It should use the same property names as the fallback, but loaded from the config file.
-
I don't think we will make that change now. Maybe in the new docs, if we eventually migrate. Users on older CI versions can always download the appropriate version of the user guide from the userguide repository.
| chmod 0700 /<path to your application directory>/writable/sessions/ | ||
| chown www-data /<path to your application directory>/writable/sessions/ | ||
| Since the built-in mechanism does not have automatic cleaning of expired sessions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% true, since we can use PHP's GC mechanism when using a file or database handler, although it's not recommended. In general, cleaning expired sessions manually is recommended for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rephrase it. I know that the default garbage collector is unlikely to work. To make it work, you need to set up a session.gc_probability session.gc_divisor.
In my test projects, the sessions dir is constantly full. Even if I restart the server after a week, the garbage collector does not fire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will only be triggered very rarely unless we set a higher probability - that's all. It works fine, but it's not recommended for production use, especially when using the file handler.
I'm still not entirely sure which option you want to describe.
649aec2 to
5214258
Compare
Description
Sessionhave been removed.FileHandler, what should I add to the guide about cleaning up old sessions? While I was reviewing the commit, I remembered about GC. Can I add information about him?I have removed the
stop()method - it is not needed for the v4.7 documentation, but people reading for v4.3 should know about it. For good measure, we need to switch to a different version system for the guide. At least clear the notes for major versions 4.4, 4.5, 4.6...Checklist: