Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 003660b

Browse files
authored
Merge pull request #49 from robertaistleitner/readme-sessionhandling
Add information on session handling to README
2 parents e92aece + 6fe4195 commit 003660b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.rst

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Usage of `Flask blueprints`_:
7373
server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)
7474
server.serve_forever()
7575
76+
Combining WebSockets with Ajax (XHR) endpoints also comes handy with the support of session handling built-in to sockets as well. As an example you could use an Ajax login call which would create a new session and accordingly set a secure HttpOnly cookie to the browser. After authorization, you can connect to the WebSocket endpoint and reuse the session handling from Flask there as well (as shown here: https://pythonhosted.org/Flask-Session/). Access to other custom cookies is also possible via Flasks ``request.cookies`` property.
77+
7678

7779
Serving WebSockets in Python was really difficult. Now it's not.
7880

0 commit comments

Comments
 (0)