Manual:$wgCookieExpiration/zh

From Linux Web Expert

Revision as of 16:06, 10 January 2024 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<translate> Cookies</translate>: $wgCookieExpiration
在HTTP cookie过期前的秒数。 您可以使用$wgExtendedLoginCookieExpiration 替换为“Keep me logged in”的cookie
<translate> Introduced in version:</translate>pre 1.1.0
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(整数)
<translate> Default value:</translate>1.18–: 30 * 86400
1.19–1.28: 180 * 86400 (r94430)
1.29+: 30 * 86400 (Gerrit change 321592)

详情

默认值为30天(30*86400秒)。 这意味着大多数MediaWiki的cookie将持续30天。 当未设置“Keep me logged in”选项时,这包括登录cookie。设置为“Keep me logged in”时,将使用$wgExtendedLoginCookieExpiration 代替(尽管默认情况下,该设置会降为Keep me logged in)。

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

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.22
<translate> MediaWiki version:</translate>

从MediaWiki 1.22开始,可将此配置变量设置为0,这样cookie就只限会话当时。 这之前曾经记载可以工作,但会损坏。

这被WebResponse::setcookiemw.cookie.set使用,尽管个别cookie可以有自定义的到期时间。

参见