Page MenuHomePhabricator

Sharing sessions don't work and breaks sessions if you change sub-domain
Closed, DuplicatePublic

Description

In MediaWiki 1.27.1 (our production release) and 1.28 (our testing release), I fail to setup a multi-domain shared session with the method explained in Manual:Shared_database#Sharing_sessions. (Without CentralAuth.)

To replicate the issue you have to:

  1. Have an account for https://en.wikitolearn.org
  2. Login into https://en.wikitolearn.org without the "remember me" checkbox selected
  3. Go to https://it.wikitolearn.org

you will be logged out from both domains.

I tried to have different sessions for each domain (now is online this version) with the

$wgSessionName = $wgCookiePrefix . "session_" . $wiki;

Where $wiki is the current wiki subdomain but the issue is the same, i think is because the user id and username cookie

I suppose this feature is broken with the 1.27 release ( * Massive overhaul to session handling )

If there is a working example that I can look at I please show me.

This is our config file

Event Timeline

Hi @Toma.luca95, thanks for taking the time to report this!
Which exact MediaWiki version is this about?

Hi,
the production is with 1.27.1 and we are testing also the 1.28.0 with the same behavior

I just saw the update on the documentation with the reference to this link.
I can't find anything about sharing the session in the page.

This patch can fix the issue, at least that what i saw in my tests

@Toma.luca95: Thanks for taking a look at the code!

You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review them quickly and provide feedback.
If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!