Manual:$wgCookieExpiration

Details
The default value is 30 days (30 * 86400 seconds). This means most MediaWiki cookies will last 30 days. This includes login/session cookies when the "" option is not set. When "" is set,  is used instead (although by default that settings falls back to  ).

When "" is not set, login expiry is also limited by   (the session expires when there is no interaction for that time span).

Since MediaWiki 1.22 setting this configuration variable to 0 makes cookies session-only. This was previously documented as working, but broken.

This is used by WebResponse::setcookie and mw.cookie.set, though an individual cookie can have a custom expiration.