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 bugs with extending the session handler class #15934

Closed
wants to merge 2 commits into from

Conversation

sergant210
Copy link
Collaborator

What does it do?

  1. Fixes the bugs from issue Logout all users action doesn't work with custom session handlers #15928.
  2. Refactoring inititialization of the session handler.

How to test

See the issue.

Related issue(s)/PR(s)

#15928.

@Ibochkarev Ibochkarev added this to the v3.0.0-rc1 milestone Dec 7, 2021
@Ibochkarev Ibochkarev added the pr/review-needed Pull request requires review and testing. label Dec 7, 2021
core/src/Revolution/modX.php Show resolved Hide resolved
core/src/Revolution/modX.php Show resolved Hide resolved
@opengeek opengeek removed this from the v3.0.0-rc1 milestone Dec 7, 2021
@sergant210 sergant210 changed the title Fixed bugs with extending of the session handler class Fix bugs with extending the session handler class Dec 8, 2021
@JoshuaLuckers

This comment has been minimized.

@cla-bot

This comment has been minimized.

@cla-bot cla-bot bot added the cla-signed CLA confirmed for contributors to this PR. label Dec 17, 2021
@Mark-H Mark-H self-requested a review January 16, 2022 23:48
@Mark-H Mark-H added this to the v3.0.0-rc2 milestone Jan 19, 2022
@opengeek opengeek modified the milestones: v3.0.0-rc2, v3.0.0-pl Feb 3, 2022
@opengeek opengeek modified the milestones: v3.0.0, v3.0.1 Mar 29, 2022
@opengeek opengeek modified the milestones: v3.0.1, v3.0.2 Apr 28, 2022
@opengeek opengeek modified the milestones: v3.0.2, v3.0.3 Nov 16, 2022
@opengeek opengeek modified the milestones: v3.0.3, v3.1.0 Jan 17, 2023
@rthrash
Copy link
Member

rthrash commented Feb 2, 2023

This pull request has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/error-flush-sessions-not-supported-when-trying-to-logout-all-users-in-modx-3/6361/2

@rthrash
Copy link
Member

rthrash commented Feb 2, 2023

This pull request has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/error-flush-sessions-not-supported-when-trying-to-logout-all-users-in-modx-3/6361/7

@Mark-H
Copy link
Collaborator

Mark-H commented Feb 10, 2024

Closing in favour of #16522 - please see my explanation there.

@Mark-H Mark-H closed this Feb 10, 2024
opengeek pushed a commit that referenced this pull request Aug 15, 2024
)

### What does it do?

- Fixes the bugs from #15928, per #15934
- Refactored inititialization of the session handler and adopt the PHP
core SessionHandlerInterface, per #15934
- Move flushing sessions logic into the session handler to optionally
allow that to be extended, per #15957

### 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

---------

Co-authored-by: sergant210 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed CLA confirmed for contributors to this PR. pr/review-needed Pull request requires review and testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants