{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/175","repository_url":"https://api.github.com/repos/miguelgrinberg/python-socketio","labels_url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/175/comments","events_url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/175/events","html_url":"https://github.com/miguelgrinberg/python-socketio/issues/175","id":309078102,"number":175,"title":"Is there any way to get access to session object in request?","user":{"login":"nuevoleonkx","id":31934700,"avatar_url":"https://avatars3.githubusercontent.com/u/31934700?v=4","gravatar_id":"","url":"https://api.github.com/users/nuevoleonkx","html_url":"https://github.com/nuevoleonkx","followers_url":"https://api.github.com/users/nuevoleonkx/followers","following_url":"https://api.github.com/users/nuevoleonkx/following{/other_user}","gists_url":"https://api.github.com/users/nuevoleonkx/gists{/gist_id}","starred_url":"https://api.github.com/users/nuevoleonkx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuevoleonkx/subscriptions","organizations_url":"https://api.github.com/users/nuevoleonkx/orgs","repos_url":"https://api.github.com/users/nuevoleonkx/repos","events_url":"https://api.github.com/users/nuevoleonkx/events{/privacy}","received_events_url":"https://api.github.com/users/nuevoleonkx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-27T18:14:32Z","updated_at":"2018-03-27T20:57:41Z","closed_at":null,"author_association":"NONE","body":"I'm using pyramid and python socket.io as Middleware, and class based namespaces in order to respond on every particular section of my project. I want to check whether a session object in my request is present.\r\n\r\nany way I can deal with? "},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/comments/376672928","html_url":"https://github.com/miguelgrinberg/python-socketio/issues/175#issuecomment-376672928","issue_url":"https://api.github.com/repos/miguelgrinberg/python-socketio/issues/175","id":376672928,"user":{"login":"miguelgrinberg","id":2715854,"avatar_url":"https://avatars0.githubusercontent.com/u/2715854?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T20:57:41Z","updated_at":"2018-03-27T20:57:41Z","author_association":"OWNER","body":"This really depends on the framework, and unfortunately I don't know much about Pyramid sessions. You can obtain the WSGI environment dictionary with `sio.environ[sid]`, where `sio` is a `Server` instance, and `sid` is the SocketIO session id assigned to the client in question.\r\n\r\nThe rest really depends on how easy or hard Pyramid makes it to replicate the HTTP environment from the WSGI environment dictionary. The session cookie is going to be in there.\r\n\r\nKeep in mind that the concept of a \"request\" does not really apply when working with SocketIO, since there is a long-term connection with each client. What you get from `sio.environ[sid]` is going to be the WSGI environment used during the SocketIO connection."}}
{"actor":{"display_login":"miguelgrinberg"}}