Here’s how you can check if a cookie exists:
if (
document.cookie.split(';').filter(item => {
return item.includes('name=')
}).length
) {
//name exists
}
Here’s how you can check if a cookie exists:
if (
document.cookie.split(';').filter(item => {
return item.includes('name=')
}).length
) {
//name exists
}