This is code in which i am setting the cookie
document.cookie = 'cookie_consent=true; expires=Fri, 31 Dec 9999 23:59:59 GMT Secure';
Below is my code for checking cookie.
useEffect(() => {
const cookieValue = (`; ${document?.cookie}`).split('; cookie_consent=').pop().split(';')[0];
if (!cookieValue) {
console.log("Cookie not avaliable");
}
}, [document?.cookie]);
Cookie is getting expired after accepting within few days since i set cookie expiry as 31 dec 9999 etc.
Thank You in advance, Any help will appreciated.