I am using React and I want to access to cookies, specifically accessToken, so that I can setLogin(true) based on existence of accessToken.
I tried document.cookies, react-cookies library, but I can't access to that cookies...
even though I can see cookies on the browser, whenever I console.log(cookies) like below, there is empty.
- When I used document.cookie
;
- When I used react-cookies
and cors Options are like below
app.use(
cors({
origin: true,
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH']
})
);
How can I know there is cookie[accessToken] and
How can I use setLogin(true) based on accessToken