Checks if a cookie exists.
The name of the cookie to check
True if the cookie exists, false otherwise
if (getHasCookie('token')) { console.log('User is authenticated');}// Or use with getCookieconst hasSession = getHasCookie('sessionId'); Copy
if (getHasCookie('token')) { console.log('User is authenticated');}// Or use with getCookieconst hasSession = getHasCookie('sessionId');
Checks if a cookie exists.