- defaultOptions = {
- prefix: config.wgCookiePrefix,
- domain: config.wgCookieDomain,
- path: config.wgCookiePath,
- secure: false
- };
-
- // Options argument can also be a shortcut for the expiry
- // Expiry can be a Date, number or null
- if ( !options || options instanceof Date || typeof options === 'number' ) {
- // Also takes care of options = undefined, in which case we also don't need $.extend()
- defaultOptions.expires = options;
- options = defaultOptions;
- } else {
- options = $.extend( defaultOptions, options );
+ // The 'options' parameter may be a shortcut for the expiry.
+ if ( arguments.length > 2 && ( !options || options instanceof Date || typeof options === 'number' ) ) {
+ options = { expires: options };