I am building a simple web app using nodejs as backend with angularjs front-end.
With nodejs I am setting some cookies after a user logs in.
res.cookie(name,value)
I am creating two cookies each for username and user_id. and when I see the set cookies, using
res.json(req.cookies)
and the json response have the actual user_id and also with a another key connect.sid, maybe because I am using connect-flash, I don't know.
But when I access the cookies in angularjs using $cookies.get('user_id') the value is some encoded value,
For eg : for actual user_id : 571be8d34666cf69664645d5,
I am getting j%3A%22571be8d34666cf69664645d5%22
How can I get the actual userid ?
I know that the real ID is in between the string and I can get it by using some string manipulation, but is there another way.
I am using passportjs, express-session, connect-flash, connect-mongo,cookie-parser in my app.
valuecome from? Is it an object?