Skip to content

[4.0] Handle session ID being a stream to fix session manager problem on logout with PostgreSQL database#33819

Closed
richard67 wants to merge 1 commit intojoomla:4.0-devfrom
richard67:4.0-dev-fix-session-manager-resource-issue-2
Closed

[4.0] Handle session ID being a stream to fix session manager problem on logout with PostgreSQL database#33819
richard67 wants to merge 1 commit intojoomla:4.0-devfrom
richard67:4.0-dev-fix-session-manager-resource-issue-2

Conversation

@richard67
Copy link
Copy Markdown
Member

Pull Request for Issue #33740 .

Alternative to #33787 and #33817 .

Summary of Changes

When reading the session id from the session table on a PostgreSQL database using loadColumn(), the result is an array of resources and not of strings.

This PR here adds a check in the destroySessions routine of the session manager if the session ID is of type resource and the resource type is a stream, and if that is the case, reads the stream and use the result string for the destroySession call.

Testing Instructions

See issue #33740 .

Actual result BEFORE applying this Pull Request

See issue #33740 .

Expected result AFTER applying this Pull Request

No errors. Session destroyed correctly. Now back at the login screen.

Documentation Changes Required

None.

@richard67
Copy link
Copy Markdown
Member Author

Added release blocker label as inherited from the issue.

@joomdonation
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on fc07b6e

Tested on both MySQLi and PostgreSQL.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33819.

@PhilETaylor

This comment was marked as abuse.

@richard67
Copy link
Copy Markdown
Member Author

@SharkyKZ How should it be done in the right way?

@richard67
Copy link
Copy Markdown
Member Author

@PhilETaylor No need to ping Robert. Maybe we get some info why, or not. Let's wait and see what happens. I am really not the PHP guru, so I'm always open for suggestions/change requests/critics, from whomever it comes.

@PhilETaylor

This comment was marked as abuse.

@PhilETaylor

This comment was marked as abuse.

@richard67
Copy link
Copy Markdown
Member Author

If @alikon 's PR #33817 doesn't get a thumb down in a while, and Nicola adds the change at the other place which I have mentioned there with a comment. then I am happy to close this one in favour of Nicola's.

@richard67
Copy link
Copy Markdown
Member Author

Closing in favour or #33817 .

@richard67 richard67 closed this May 12, 2021
@richard67 richard67 deleted the 4.0-dev-fix-session-manager-resource-issue-2 branch May 12, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants