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
}
Join my AI Workshop!
The Web Development BOOTCAMP cohort starts in February 2026