This repository has been archived by the owner on Nov 15, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not alter options object in $.removeCookie (consider that a refere…
…nce may have been passed), closes #175
- Loading branch information
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,8 @@ | |
|
||
$.removeCookie = function (key, options) { | ||
if ($.cookie(key) !== undefined) { | ||
$.cookie(key, '', $.extend(options, { expires: -1 })); | ||
// Must not alter options, thus extending a fresh object... | ||
$.cookie(key, '', $.extend({}, options, { expires: -1 })); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
FagnerMartinsBrack
Collaborator
|
||
return true; | ||
} | ||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The -1 expiry is turning the cookie into a session cookie. Yet I see v1.3.1 on the plugin registry is using "null" instead of empty string for the value and has no expiry. And it works at least in PhantomJS.
Is this a regression or old code or ... ?