Page MenuHomePhabricator

Session duration is not correctly enforced
Open, Needs TriagePublicBUG REPORT

Description

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

  • Log in to one of the WMF wikis, but don't choose the "remember me for 365 days" option
  • Make some edits, notice the time you did your last edit
  • Leave the browser open for more than 12 hours but less than 24 hours; in that period, don't use the browser at all
  • Return to that browser and refresh the wiki page you were on last
  • Notice if you are still logged in or not

What happens?:

  • Sometimes you stay logged in (in my experience, it is about 80% of the time); other times, you find yourself logged out

What should have happened instead?:

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): 1.44.0-wmf.17 (1abfde3)

I am adding a WMF tag and a MW tag, because I am unsure if this is a site config issue or an underlying software issue that results in the session expiry not to be honored.

Event Timeline

Thanks for reporting! Are you willing to do some debugging around this? If you could provide the exact timestamp for the last logged-in request and the first not-logged-in request, I could check if the logs contain anything useful.

Also can you check whether the cookie lifetime for the various authentication cookies (<wiki>Session, <wiki>UserName, centralauth_Session, centralauth_User) are 24+ hours as expected? And tell what browser you are using?

There are a number of things that could go wrong:

  • Kask expiry (set correctly but who knows)
  • SessionBackend::renew() doing something bad
  • the browser restricting cookie lifetime as part of anti-tracking protections (e.g. Safari ITP or Firefox ETP)
  • SessionManager deeming the session invalid for some non-expiry-related reason

Thanks for reporting! Are you willing to do some debugging around this? If you could provide the exact timestamp for the last logged-in request and the first not-logged-in request, I could check if the logs contain anything useful.

Yes I am happy to. I will have to wait for it to occur again, but I will pay attention to collect the details this time and will securely share it with you.

Also can you check whether the cookie lifetime for the various authentication cookies (<wiki>Session, <wiki>UserName, centralauth_Session, centralauth_User) are 24+ hours as expected? And tell what browser you are using?

Firefox on Mac. <wiki>Session and centralauth_Session have an expiry value of "Session" (i.e. no specific date and time). <wiki>UserName and <wiki>UserID and centralauth_User have an expiry that is approximately 32 days in the future.

@Tgr it happened again. I have provided some details in this private paste: P73705

Of note, the session ID I shared is likely a newly assigned session ID for my logged out state. There are non <wiki>Session, centralauth_Session, or centralauth_User keys in my cookies. The only key that exists is the <wiki>mwuser-sessionId which I referenced in that paste. If you need additional details, I can provide them within reason.

Ah, it gets more complicated! Note that I was logged out when I refreshed the page. I clicked the login link, and instead of going to the login page, it logged me in! This is different from the last time I had this experience (that time, clicking on the login link took me to the login form).

@Tgr it happened one again. This time, it didn't log me back in when I clicked on the login link. I had to properly login with my username and password. The duration of inactivity was only around 12 hours. I have updated P73705 accordingly.

It happened again. And similar to last time, it resulted in me having to log in again. Duration of inactivity was around somewhere between 12 and 13 hours in both of these cases.

FYI it keeps happening every few days, at random times.

The most extreme version of it happened today, when I made an edit and literally 10 minutes later, the wiki forced me to log in again. All I did was refresh the page in the tab that was open since my edits.