clear cookies js
function deleteAllCookies() {
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
deleteAllCookies();function deleteCookie(name) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}document.cookie.split(";")
.forEach(function(c) {
document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); });
Also in JavaScript:
- angular add bootstrap
- jquery detect nav tab change event
- pdf.js change background color
- loopback UserModel.setter.password overwrite
- alternative for componentdidmount
- react array if id is present do not add element
- how to print an array javascript
- how to clone an object in javascript
- vue current year
- Converting circular structure to JSON
- ngswitchcase in angular 8
- element.classname javascript
- adding int and string in react props
- switch in react
- detect scroll javascript
- js hide element by id
- reduce method javascript
- download .json file
- custom font in react native
- angular material theme colors
- javascript nameof
- unterminated character class react native
- js localstorage boolean
- javascript string includes substring