I’m using cookies-next to set a cookie in NextJS, like so (pages router, client side as per docs):
const cookieOptions = {
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 399), // 399 days (max cookie age in chrome is 400),
};
setCookie("segmentation", segmentation, cookieOptions);
the cookie is properly set, and works, if navigated around the site with normal next js routing:
however, after manually reloading, or closing the tab and coming back to the site, the cookies is shown for a brief second and then disapears.