JavaScript Hapus Cookie
function deleteCookie(name) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
TC5550
function deleteCookie(name) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
document.cookie = "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
function onRemoved(cookie) {
console.log(`Removed: ${cookie}`);
}
function onError(error) {
console.log(`Error removing cookie: ${error}`);
}
function removeCookie(tabs) {
var removing = browser.cookies.remove({
url: tabs[0].url,
name: "favorite-color"
});
removing.then(onRemoved, onError);
}
var getActive = browser.tabs.query({active: true, currentWindow: true});
getActive.then(removeCookie);
Cookie userNameCookieRemove = new Cookie("userName", "");
userNameCookieRemove.setMaxAge(0);
response.addCookie(userNameCookieRemove);