Skip to content

A platform for community discussion. Free, open, simple.

FIX: Do not set null value to remove cookie

Vinoth Kannan08c404e138c5
diff --git a/app/assets/javascripts/discourse/components/global-notice.js.es6 b/app/assets/javascripts/discourse/components/global-notice.js.es6
index 327f6aa79af..5041da17131 100644
--- a/app/assets/javascripts/discourse/components/global-notice.js.es6
+++ b/app/assets/javascripts/discourse/components/global-notice.js.es6
@@ -11,7 +11,7 @@ export default Ember.Component.extend(
let notices = [];
if ($.cookie("dosp") === "1") {
- $.cookie("dosp", null, { path: "/" });
+ $.removeCookie("dosp", { path: "/" });
notices.push([I18n.t("forced_anonymous"), "forced-anonymous"]);
}
diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create-account.js.es6
index 22848d8a2f4..c4f1b20fc50 100644
--- a/app/assets/javascripts/discourse/controllers/create-account.js.es6
+++ b/app/assets/javascripts/discourse/controllers/create-account.js.es6
@@ -260,12 +260,12 @@ export default Ember.Controller.extend(
this.get("rejectedPasswords").pushObject(attrs.accountPassword);
}
this.set("formSubmitted", false);
- $.cookie("destination_url", null);
+ $.removeCookie("destination_url");
}
},
() => {
this.set("formSubmitted", false);
- $.cookie("destination_url", null);
+ $.removeCookie("destination_url");
return this.flash(I18n.t("create_account.failed"), "error");
}
);
diff --git a/app/assets/javascripts/discourse/controllers/login.js.es6 b/app/assets/javascripts/discourse/controllers/login.js.es6
index 7d10818420a..c3aecebae0c 100644
--- a/app/assets/javascripts/discourse/controllers/login.js.es6
+++ b/app/assets/javascripts/discourse/controllers/login.js.es6
@@ -158,12 +158,12 @@ export default Ember.Controller.extend(ModalFunctionality, {
.val(self.get("loginPassword"));
if (ssoDestinationUrl) {
- $.cookie("sso_destination_url", null);
+ $.removeCookie("sso_destination_url");
window.location.assign(ssoDestinationUrl);
return;
} else if (destinationUrl) {
// redirect client to the original URL
- $.cookie("destination_url", null);
+ $.removeCookie("destination_url");
$hidden_login_form
.find("input[name=redirect]")
.val(destinationUrl);
diff --git a/app/assets/javascripts/discourse/lib/theme-selector.js.es6 b/app/assets/javascripts/discourse/lib/theme-selector.js.es6
index ce806b44965..69a2eeb935d 100644
--- a/app/assets/javascripts/discourse/lib/theme-selector.js.es6
+++ b/app/assets/javascripts/discourse/lib/theme-selector.js.es6
@@ -38,7 +38,7 @@ export function setLocalTheme(ids, themeSeq) {
expires: 9999
});
} else {
- $.cookie("theme_ids", null, { path: "/", expires: 1 });
+ $.removeCookie("theme_ids", { path: "/", expires: 1 });
}
}