Skip to content

docs: Notes about switching types in session #9508

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

Merged

Conversation

neznaika0
Copy link
Contributor

Description
See #9505 (comment)

  • Added a clarification.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@neznaika0
Copy link
Contributor Author

Снимок экрана от 2025-04-08 10-52-22

I would add another note about clearing expired sessions. But I don't fully know how to do it.
Example:

For FileHandler, you can clear files using cron.

Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add another note about clearing expired sessions. But I don't fully know how to do it.

Probably something like this:

0 2 * * * find /path/to/your/project/writable/session -type f -name 'ci_session*' -mmin +1440 -delete

It will delete stale sessions that haven’t been used for more than 24 hours.

  • The session path should be set to: Config\Session::$savePath.
  • The session name should be set to: Config\Session::$cookieName
  • The user running the cron job should have permission to access and delete those session files.

Copy link
Contributor Author

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Deleting expired session files

image

@neznaika0 neznaika0 changed the title docs: Note about switching types in session docs: Notes about switching types in session, deleting expired session Apr 8, 2025
@neznaika0 neznaika0 force-pushed the docs/improve-session-data branch from 3f84112 to ad8ba45 Compare April 9, 2025 12:13
@michalsn michalsn changed the title docs: Notes about switching types in session, deleting expired session docs: Notes about switching types in session Apr 9, 2025
Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar fix.

@paulbalandan paulbalandan added the documentation Pull requests for documentation only label Apr 10, 2025
@neznaika0 neznaika0 force-pushed the docs/improve-session-data branch from ad8ba45 to e4bff61 Compare April 11, 2025 06:55
@paulbalandan paulbalandan merged commit 49a56da into codeigniter4:develop Apr 12, 2025
9 checks passed
@neznaika0 neznaika0 deleted the docs/improve-session-data branch April 12, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants