Page MenuHomePhabricator

Session lost when working on two projects (e.g. Commons and plwiki)
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Nux
Jun 2 2026, 4:40 PM
Referenced Files
F12: project.png
Jun 8 2026, 11:07 PM
File Not Attached
F87514254: obraz.png
Jun 8 2026, 11:07 PM
F87421801: 2026-06-08 14-27-07.webm
Jun 8 2026, 7:18 PM
F87257217: obraz.png
Jun 7 2026, 6:55 PM
F86471984: 2026-06-03 20-21-14-VP9.webm
Jun 3 2026, 7:43 PM
F86441059: obraz.png
Jun 3 2026, 3:12 PM
F86439787: obraz.png
Jun 3 2026, 3:06 PM
F86253626: obraz.png
Jun 2 2026, 4:40 PM

Description

Steps to replicate the issue (include links if applicable):

  • Open pages for review on plwiki (or for edit).
  • Open some pages on Commons (I use this for comparing images).
  • Try to do review action.

I can repeat this EVERY TIME. E.g. refresh in this order:

  1. Refresh tab on plwiki (I should get a fresh CSRF token here).
  2. Refresh tabs from Commons (I assume my plwiki token is lost).
  3. Try to do action on plwiki.

What happens?:

I cannot do the review action.

What should have happened instead?:

Session on Commons should not depend on the session on plwiki.

BTW. That is not how most OAuth / SSO works. Not sure why the sessions are connected. I assume you are reusing CSRF token space (clearing it on Commons and then the token generated on plwiki no longer works).

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

plwiki:

obraz.png (1,564×340 px, 61 KB)

Commons:

obraz.png (1,314×784 px, 117 KB)

Event Timeline

Can you go into more detail on how the action fails? Or redo the screenshot with uselang=en?

Sure. I assume this is not specific to reviews, as I had similar session problems when working on templates. But here are the steps with actions as I reported above:

  1. Check for unreviewed articles: https://pl.wikipedia.org/w/index.php?title=Specjalna%3AZdezaktualizowane_przejrzane_strony&namespace=&category=&size=500
  2. Click Review link on the first item. You need editor rights for that (*).
  3. I went to: https://pl.wikipedia.org/w/index.php?title=Olejua&diff=cur&oldid=78558118
  4. Refresh tab(s) from Commons, e.g. visit: https://commons.wikimedia.org/wiki/File:Phase_change_-_en.svg
  5. Click the Accept revision action on plwiki (**).

obraz.png (902×553 px, 69 KB)

The message is:

There seems to be a problem with your login session;
this action has been canceled as a precaution against session hijacking.
Please resubmit the form.

(*) I added editor rights on plwiki for six months on this account:
https://pl.wikipedia.org/wiki/Wikipedysta:Tgr

(**) Don't worry, the action won't work, so you can safely try it out :). Also that specific change in Olejua is fine, so no worries if you do accept it. You will also be able to Unaccept revision.

Oh. I should probably have mentioned that I use Firefox 151.0.2 on Windows 11. If the issue is somehow related to cookies, then IIRC Firefox still handles them differently than Chrome in some cases. I do have privacy features disabled for Wikimedia sites (the tracking shield is disabled):

obraz.png (221×47 px, 2 KB)

I can't reproduce the problem. This is on Firefox 152.0b6 on Windows 10. Screen recording:

I suspect it is caused for you by some site script, gadget or user script performing cross-wiki actions in the background. I did my testing with safe mode enabled, so that no scripts are active. Can you still reproduce if you enable safe mode ("tryb bezpieczny") in your global preferences? https://meta.wikimedia.org/wiki/Special:GlobalPreferences#mw-prefsection-rendering-advancedrendering

(Separately: FlaggedRevs should retry once (with a new token) on these errors, as they can also happen if you open the tab and just wait long enough for the token to expire. The current code doesn't do that: https://gerrit.wikimedia.org/g/mediawiki/extensions/FlaggedRevs/+/8da2e6e8ee5f620e3c5dfbb297f853ceebe270ea/modules/ext.flaggedRevs.review/review.js#131)

Strange. Something changed I cannot repeat original steps, but I can repeat in safe mode like this:

  1. https://pl.wikipedia.org/w/index.php?title=Droga_wojew%C3%B3dzka_nr_501&diff=cur&oldid=77157467&safemode=1
  2. https://commons.wikimedia.org/wiki/File:Phase_change_-_en.svg?safemode=1
  3. View notifications on Commons (loads fine).
  4. Try to review on plwiki -> fail.

Same with editing templates so not specific to reviews:

  1. https://pl.wikipedia.org/w/index.php?title=Szablon:Piechart/test&action=submit&safemode=1 (I think it needs to be a locked page, as I couldn't reproduce the issue on an unlocked page on English Wikipedia)
  2. https://commons.wikimedia.org/wiki/File:Phase_change_-_en.svg?safemode=1
  3. View notifications on Commons (loads fine).
  4. Add "." in the Piechart/test page (on plwiki) and try to save -> fail.

obraz.png (1,213×169 px, 18 KB)

That doesn't trigger it for me either:

I'll be at the WMPL meeting next weekend, I see you're signed up as well, so perhaps we can try to debug it in person :D (I hope it reproduces on your laptop)

(If that doesn't work out, you could also use WikimediaDebug to enable more detailed server-side logs, and send over a client-side network recording as a HAR file from browser developer tools.)

Hm... Heh. Something keeps changing. Now I'm getting Error: View mediainfoview does not exist (T321532) on a file page and could not reproduce.... Not sure if banners could affect the tests. They seem to change a lot lately....

Anyway. Here are the current steps:

  1. https://pl.wikipedia.org/w/index.php?title=Droga_wojew%C3%B3dzka_nr_501&diff=cur&oldid=77157467&safemode=1
  2. https://commons.wikimedia.org/wiki/Category:Flags?safemode=1
  3. View notifications on Commons (loads fine).
  4. Try to review on plwiki -> fail.

Video (btw the player in Phab seems to be broken):
https://youtu.be/ivm4kYPzslw

Probably crucially echo does a Foreign API call:

obraz.png (1,736×243 px, 72 KB)

I can repeat with more minimized steps:

  1. https://pl.wikipedia.org/w/index.php?title=Droga_wojew%C3%B3dzka_nr_501&diff=cur&oldid=77157467&safemode=1 (visit or refresh)
  2. On any page on Commons or Meta open console and run below script with F12 tools.
  3. Try to review on plwiki -> fail.
var api = new mw.ForeignApi( 'https://pl.wikipedia.org/w/api.php' );
api.get( {
    action: 'query',
    meta: 'userinfo'
} ).done( function ( data ) {
    console.log( data );
} );
Nux claimed this task.

Matma suggested last weekend it might be some old cookies and it was. I cleared my cookies on both plwiki and commons and the problem is gone. Weird, but I'm OK with that 🙂