Skip to content

Is is possible to use express-session for cookie-based authentication? #257

Answered by enisdenjo
pedromsfernandes asked this question in Q&A
Discussion options

You must be logged in to vote

Cookies are automatically added to the headers of WebSocket HTTP upgrade requests by the browser.

Authenticate the client the same way you would a regular HTTP request. A great place to do auth is in the onConnect callback, you may find the HTTP upgrade request in the ctx.extra.request.

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
4 replies
@pedromsfernandes
Comment options

@Nickersoft
Comment options

@enisdenjo
Comment options

@Nickersoft
Comment options

Answer selected by pedromsfernandes
Comment options

You must be logged in to vote
8 replies
@CemYil03
Comment options

@enisdenjo
Comment options

@CemYil03
Comment options

@CemYil03
Comment options

@enisdenjo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants