Skip to content
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

Fix issues with extending modSessionHandler and flushing all sessions #16522

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

Mark-H
Copy link
Collaborator

@Mark-H Mark-H commented Feb 10, 2024

What does it do?

Why is it needed?

In two stale PRs #15928 and #15957 we have two proposals for dealing with some bugs and extending session handlers. While trying to figure out which one to use, I found both to have a solid approach, and wanting to use one bit of one and another part of other PR.

This proposal replaces both those PRs as a middle ground, taking the most benefit from both approachs.

Breaking changes

This change includes a small breaking change in order to adopt the PHP standard SessionHandlerInterface, namely adding parameters into the open() method. There's not really any way around that in order to adopt the standard.

As extending session handlers is a pretty advanced thing that I assume not many people have done, I suggest we accept that for the sake of getting closer to the standards, but make special note of this breaking change in the docs for 3.1 and the announcement to make sure people learn about it in case custom handlers need to be adjusted.

How to test

Flush sessions

Related issue(s)/PR(s)

Replaces #15934 and #15957
Fixes #15928

Copy link

codecov bot commented Feb 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 21.68%. Comparing base (73bfd27) to head (ac621d1).
Report is 146 commits behind head on 3.x.

Files Patch % Lines
core/src/Revolution/Processors/Security/Flush.php 0.00% 8 Missing ⚠️
core/src/Revolution/modSessionHandler.php 0.00% 8 Missing ⚠️
core/src/Revolution/modX.php 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                3.x   #16522   +/-   ##
=========================================
  Coverage     21.68%   21.68%           
  Complexity    10496    10496           
=========================================
  Files           561      561           
  Lines         31703    31699    -4     
=========================================
  Hits           6875     6875           
+ Misses        24828    24824    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@theboxer theboxer left a comment

Choose a reason for hiding this comment

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

Thanks for merging the 2 prs into a solid one :) I'm fine with introducing such a small breaking change in the minor release.

@opengeek opengeek merged commit 58c4699 into modxcms:3.x Aug 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logout all users action doesn't work with custom session handlers
4 participants