TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to maintain session along with Websockets?

2 pointsby subho007almost 11 years ago
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<p>Any help?

2 comments

mjhea0almost 11 years ago
<a href="https://www.youtube.com/watch?v=tqu9y4iqKVI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=tqu9y4iqKVI</a>
stephenblumalmost 11 years ago
Hi Sub, you are asking for security question I believe. You need to make sure you pass an unpredictable &quot;session&quot; token.