Answer the question
In order to leave comments, you need to log in
How to check for a cookie in pure JavaScript?
Please tell me how to check the presence of a cookie in pure JavaScript
Answer the question
In order to leave comments, you need to log in
Thanks everyone, this helped
if (document.cookie.indexOf("nameCookie") == 0) {
console.log('Куки есть');
}else{
console.log('Куки нет');
}
Why didn't the first link from Google work? https://learn.javascript.ru/cookies
Look in document.cookie .
But if the cookie is set with the HTTP-Only flag, then nothing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question