From b65aea33c9ed5e731c8f4064db0f958cb9914058 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 23 Jan 2015 17:13:13 -0800 Subject: [PATCH] mediawiki.cookie: Re-add documentation about non-zero default expiration Follows-up 81319eb28d7538d12ff6b. The statement was accurate, but somewhat confusingly phrased. Change-Id: I718831ff23309187e30ba7e304fbd0e0ed0182fd --- resources/src/mediawiki/mediawiki.cookie.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- 2.20.1