mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-27 03:09:11 -04:00
Revert "Merge pull request #3238 from alphagov/cookies-update"
This reverts commiteec4bec761, reversing changes made to64480e2fff.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
// Helper for deleting a cookie
|
||||
function deleteCookie (cookieName) {
|
||||
|
||||
document.cookie = cookieName + '=; path=/; expires=' + (new Date());
|
||||
|
||||
};
|
||||
|
||||
function setCookie (name, value, options) {
|
||||
if (typeof options === 'undefined') {
|
||||
options = {};
|
||||
}
|
||||
var cookieString = name + '=' + value + '; path=/;domain=' + window.location.hostname;
|
||||
if (options.days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (options.days * 24 * 60 * 60 * 1000));
|
||||
cookieString = cookieString + '; expires=' + date.toGMTString();
|
||||
}
|
||||
document.cookie = cookieString;
|
||||
};
|
||||
|
||||
exports.deleteCookie = deleteCookie;
|
||||
exports.setCookie = setCookie;
|
||||
Reference in New Issue
Block a user