Page MenuHomePhabricator

"Keep me logged in" checkbox should not be displayed when it has no effect
Closed, InvalidPublic

Description

"Keep me logged in" changes login cookie expiration from default to $wgExtendedLoginCookieExpiration. When the latter is not set, it has no effect and should not be visible.

Fixing it probably involves changing getRememberUserDuration() in CookieSessionProvider and CentralAuthSessionProvider to return null instead of the normal cookie lifetime in that case (which it should be doing anyway according to its documentation). That will in effect disable RememberMeAuthenticationRequest.

Event Timeline

Change 301437 had a related patch set uploaded (by Florianschmidtwelzow):
AuthManager: Don't display wpRemember if it doesn't have any effect

https://gerrit.wikimedia.org/r/301437

Change 301530 had a related patch set uploaded (by Gergő Tisza):
CentralAuthSessionProvider: handle the case of no extended duration properly

https://gerrit.wikimedia.org/r/301530

Anomie subscribed.

This is false. The checkbox absolutely does have an effect even if $wgExtendedLoginCookieExpiration is not set.

With the checkbox checked, the Token cookie is set and the login lasts for the configured number of days (default 180 days), whether that configuration comes from $wgExtendedLoginCookieExpiration or $wgCookieExpiration.

When the checkbox is not checked, the Token cookie is not set and the login lasts only as long as session does, ending when the user closes their browser or when they've been inactive for $wgObjectCacheSessionExpiry seconds (default 1 hour).

Er, yes, sorry, I got very confused :( You need to set $wgExtendedLoginCookieExpiration to zero, nut null (or set it to null and normal cookie expiration to zero) for the checkbox to not have an effect. And the current code does handle that possibility correctly, and hides the checkbox.

Change 301530 abandoned by Gergő Tisza:
CentralAuthSessionProvider: handle the case of no extended duration properly

https://gerrit.wikimedia.org/r/301530

Change 301437 abandoned by Gergő Tisza:
CookieSessionProvider: handle the case of no extended duration properly

https://gerrit.wikimedia.org/r/301437