Page MenuHomePhabricator

Investigate why tools do not stay logged in for the duration of the session cookie
Open, HighPublic

Description

Reported at T224358 for Tool-global-search, but we see the same issue with XTools and our other projects that use Symfony and/or the mediawiki/oauthclient library.

The cookie is set to expire an entire year after login, but users get logged out within as little as half an hour, or sometimes just a matter of minutes.

For XTools specifically, it's worth noting we use MariaDB-based session storage (as the session needs to be shared between the app server and API server), but the symptoms nonetheless are the same as all other tools that use other session storage mechanisms.

I suspect our issue is something fundamental that we're missing with session management in PHP.

Event Timeline

I can confirm that when using it throughout the day to find and keep track of my progress fixing deprecated JS stuff on-wiki, that it feels like I can never get it to stay logged in for more than 30 minutes or an hour at a time.

Almost every time I revisit one of the tabs to renew or tune the search query, I have to go through the OAuth cycle again.

@Krinkle @Billinghurst I think I may have fixed this for Global Search. I've been logged in now for 15+ hours, which is a new record for me. Can either of you confirm you're also seeing longer login sessions?

The same fix did not appear to work for XTools. Investigation is ongoing.

@MusikAnimal <dancing> logged in for a couple of days now

MusikAnimal removed subscribers: Billinghurst, Krinkle.

Great! I am going to untag Tool-global-search and remove you two as subscribers, assuming you probably don't want to bothered about noise with us debugging XTools.

@Samwilson FYI this is what I did, which will probably work for any other Toolforge-based Symfony app: https://github.com/MusikAnimal/global-search/commit/12086c28a70e92ec86bf5ab6416466ffbf7a6964. The issue I believe is Symfony by default falls back to php.ini, which on Toolforge has sessions live for a mere 24 minutes. The same trick didn't work for XTools.