From: Timo Tijhof Date: Sat, 24 Jan 2015 01:13:13 +0000 (-0800) Subject: mediawiki.cookie: Re-add documentation about non-zero default expiration X-Git-Tag: 1.31.0-rc.0~12612^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=b65aea33c9ed5e731c8f4064db0f958cb9914058;p=lhc%2Fweb%2Fwiklou.git mediawiki.cookie: Re-add documentation about non-zero default expiration Follows-up 81319eb28d7538d12ff6b. The statement was accurate, but somewhat confusingly phrased. Change-Id: I718831ff23309187e30ba7e304fbd0e0ed0182fd --- diff --git a/resources/src/mediawiki/mediawiki.cookie.js b/resources/src/mediawiki/mediawiki.cookie.js index 1b86b61255..85f4ffa438 100644 --- a/resources/src/mediawiki/mediawiki.cookie.js +++ b/resources/src/mediawiki/mediawiki.cookie.js @@ -27,12 +27,14 @@ * @param {string|null} value Value of cookie. If `value` is `null` then this method will * instead remove a cookie by name of `key`. * @param {Object|Date} [options] Options object, or expiry date - * @param {Date|null} [options.expires=wgCookieExpiration] The expiry date of the cookie. + * @param {Date|null} [options.expires] The expiry date of the cookie. * - * Default cookie expiration is based on `wgCookieExpiration`. If `wgCookieExpiration` is - * 0, a session cookie is set (expires when the browser is closed). + * If `options.expires` is null, then a session cookie is set. + * + * By default cookie expiration is based on `wgCookieExpiration`. Similar to `WebResponse` + * in PHP, we set a session cookie if `wgCookieExpiration` is 0. And for non-zero values + * it is interpreted as lifetime in seconds. * - * If options.expires is null, then a session cookie is set. * @param {string} [options.prefix=wgCookiePrefix] The prefix of the key * @param {string} [options.domain=wgCookieDomain] The domain attribute of the cookie * @param {string} [options.path=wgCookiePath] The path attribute of the cookie