mediawiki.cookie: Re-add documentation about non-zero default expiration
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 24 Jan 2015 01:13:13 +0000 (17:13 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 24 Jan 2015 01:13:13 +0000 (17:13 -0800)
Follows-up 81319eb28d7538d12ff6b. The statement was accurate, but
somewhat confusingly phrased.

Change-Id: I718831ff23309187e30ba7e304fbd0e0ed0182fd

resources/src/mediawiki/mediawiki.cookie.js

index 1b86b61..85f4ffa 100644 (file)
                 * @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