News for hackers. Stuff that matters.

Ask HN: How to maintain session along with Websockets?

I am using Flask, Gevent and Websocket for python. How can I use flask session inside the Websocket connection? Rather how will I know that this websocket connection was initiated by this user? If i pass a username as token then anyone can access it with other username also ! Any idea about how that can be solved? I am using * Flask * Flask-Login * SQLAlchemy

Any help?

( 2 comments | 2 points | on HN )
Re:Ask HN: How to maintain session along with Websockets? by mjhea0 on Thursday July 17, 2014 @12:39PM (#8048531)
Re:Ask HN: How to maintain session along with Websockets? by stephenblum on Monday July 14, 2014 @12:20PM (#8031632)
Hi Sub, you are asking for security question I believe. You need to make sure you pass an unpredictable "session" token.