HTL
HTL

Reputation: 59

How i verify token, that was stored in cookie httpOnly on browser?

i use express in back end and this is my token was stored in browser enter image description here

My question is "how i verify or get the value as "access_token" name was stored in cookie httpOnly to my expressjs app"?

Upvotes: 0

Views: 844

Answers (1)

raizo
raizo

Reputation: 144

Express has a package called cookie-parser on npm you can install it using npm install --save cookie-parser. Then initialize it like this

const cookieParser = require("cookie-parser");

const app = express();
app.use(cookieParser());

Which lets you access req.cookies in your route.

Upvotes: 1

Related Questions