I am really confused how to set up sessions with my nodejs application. I use express + socksjs and itโs hard for me to figure out how to bind a ws connection to a specific user session.
On the sockjs page, they say that they donโt use cookies for authorization, but if I donโt send the session from the cookie when establishing a ws connection (a cookie with a previously established Express session), how can I bind this specific ws connection to a specific user?
I would like to achieve these simple goals: - The user (logged in or guest) visits the page and establishes a ws connection - I store in redis a pair of connection identifier and session id key values, so I know which user who is given the ws connection belongs to
How to do this if I cannot send a session from a cookie right after a ws connection is established? Even if I wanted, the cookie is unavailable due to HttpOnly and therefore cannot be read via js.
edit:
this post in google group offers me to send encrypted user data to the first message that sounds good, but still I'm not sure where I should get these details from. I always did this through sessions and cookies ...
source share