PR-6.2-dev Failure

User tests: Successful: Unsuccessful:

avatar NicolasDerumigny
NicolasDerumigny
17 Aug 2026

Pull Request resolves #46587.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Modify the behaviour of the cookie authenticator. Instead of rotating the token and deleting the previous one in the database, keep the old one in the database and delete it only upon successful login with the new token. This circumvents race conditions in which multiple requests with the same cookies arrive simultaneously and cases in which the connection is cut on the user side before the cookie update happens/

Testing Instructions

  • Login with the remember me option checked.
  • In the browser, delete all session cookies (simulate the end of the session)
  • In the js console, execute (20 requests in parallel to the server, each triggering potentially a cookie update):
Promise.all([fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}, {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}, {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}, {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}, {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'}),fetch("/component/ajax/?format=json", {method: 'POST'})])
  • wait ~5-10 second to ensure execution of al requests
  • refresh the page

Actual result BEFORE applying this Pull Request

The user gets disconnected from all of his devices

Expected result AFTER applying this Pull Request

The user remains connected on all of his devices.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar NicolasDerumigny NicolasDerumigny - open - 17 Aug 2026
avatar NicolasDerumigny NicolasDerumigny - change - 17 Aug 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2026
Category ⇒ Front End Plugins
avatar NicolasDerumigny NicolasDerumigny - change - 17 Aug 2026
The description was changed
avatar NicolasDerumigny NicolasDerumigny - edited - 17 Aug 2026
avatar NicolasDerumigny NicolasDerumigny - change - 17 Aug 2026
The description was changed
avatar NicolasDerumigny NicolasDerumigny - edited - 17 Aug 2026
avatar NicolasDerumigny NicolasDerumigny - change - 17 Aug 2026
Labels Added: PR-6.2-dev
avatar NicolasDerumigny NicolasDerumigny - change - 17 Aug 2026
Title
…
Dev/nderumig/cookie fix
fix(cookie auth): fix concurrency #46587
avatar NicolasDerumigny NicolasDerumigny - edited - 17 Aug 2026
avatar tecpromotion tecpromotion - change - 17 Aug 2026
Title
…
fix(cookie auth): fix concurrency #46587
[6.2] fix(cookie auth): fix concurrency #46587
avatar tecpromotion tecpromotion - edited - 17 Aug 2026
avatar NicolasDerumigny
NicolasDerumigny - comment - 19 Aug 2026

Thanks for the feedback! I am seeing bugs in my testing environment, so converting this PR to draft until this is sorted.

avatar NicolasDerumigny
NicolasDerumigny - comment - 19 Aug 2026

Thanks for the feedback! I am seeing bugs in my testing environment, so converting this PR to draft until this is sorted.
Edit: found and updated in the last commit.

avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2026
Category Front End Plugins ⇒ SQL Administration com_admin Postgresql Installation Front End Plugins
avatar NicolasDerumigny NicolasDerumigny - change - 19 Aug 2026
The description was changed
avatar NicolasDerumigny NicolasDerumigny - edited - 19 Aug 2026
avatar brianteeman
brianteeman - comment - 25 Sep 2026

I am not convinced that this is a correct fix if i understood it correctly

The existing schema deliberately makes series unique. The PR removes that uniqueness in both MySQL and PostgreSQL and then changes authentication from "there must be exactly one matching record" to "there may be several records; accept whichever token verifies".

avatar NicolasDerumigny
NicolasDerumigny - comment - 25 Sep 2026

Indeed. But as far as I know, there is no way in PHP to reliably set up a critical section where only one request is allowed to execute. Furthermore, nothing guarantees that the response (i.e., cookie update) is actually received by the client, which currently cause a spurious logout on all sessions.

avatar NicolasDerumigny
NicolasDerumigny - comment - 25 Sep 2026

Indeed. But as far as I know, there is no way in PHP to reliably set up a critical section where only one request is allowed to execute. Furthermore, nothing guarantees that the response (i.e., cookie update) is actually received by the client, which currently cause a spurious logout on all sessions.
Also, it accepts whichever token verifies, but then still deletes all previous tokens on successful login, so rotation still occurs. In a case where cookie update was performed flawlessly, then only 2 tokens per session (old one / new one) are kept in memory.

avatar NicolasDerumigny
NicolasDerumigny - comment - 25 Sep 2026

Indeed. But as far as I know, there is no way in PHP to reliably set up a critical section where only one request is allowed to execute. Furthermore, nothing guarantees that the response (i.e., cookie update) is actually received by the client, which currently cause a spurious logout on all sessions.
Also, it accepts whichever token verifies, but then still deletes all previous tokens on successful login, so rotation still occurs. In a case where cookie update was performed flawlessly, then only 2 tokens per session (last one / current one) are kept in memory.

avatar github-actions[bot]
github-actions[bot] - comment - 29 Sep 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Add a Comment

Login with GitHub to post a comment