Skip to content Skip to sidebar Skip to footer

How Do I Get The Session Id Of The Connecting Client In A Socket.io Python Server?

I have something like this: from flask import Flask, jsonify, request, render_template, Response from flask_socketio import SocketIO, emit app = Flask(__name__) socketio = SocketIO

Solution 1:

At version 1.x and higher you can use request.sid to achieve the session ID. Use emit() with the argument room=session_id to emit to a specific client.


Post a Comment for "How Do I Get The Session Id Of The Connecting Client In A Socket.io Python Server?"