After surfing the web about cookies and session I am creating a simple login in nodejs using express with cookie/session using redis as my data storage.
What do you think is the best way to handle cookies/session after the user logs in? I also have these question in my mind:
- How do i prevent using userA cookie to inject to userB's browser?
- Do I need to check the value of the cookies before performing any process?
- Using
cookieParser
is it safe that the connect.sid is unique in every browser? app.use(session({secret: 'secretkey', key: 'quser'}));
what is thissecret
all about?
I can't make up my mind on how i'm gonna use them in a proper way. Thanks guys.