Commit 02a47eab authored by Jörg Richter's avatar Jörg Richter

Utils: add `deleteCookie()`

See dmx-platform/dmx-platform#327
parent c75309cc
Pipeline #8563 passed with stage
in 2 seconds
......@@ -106,6 +106,15 @@ function setCookie (name, value) {
document.cookie = `${name}=${value};path=/`
}
function deleteCookie (name) {
// Note: setting the expire date to yesterday removes the cookie
var days = -1
var expires = new Date()
expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000)
//
document.cookie = `${name}=;path=/;expires=${expires.toGMTString()}`
}
// ---
const luceneSymbols = [
......@@ -156,5 +165,6 @@ export default {
isEmpty,
getCookie,
setCookie,
deleteCookie,
fulltextQuery
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment