{"action":"created","issue":{"url":"https://api.github.com/repos/andrewgodwin/channels/issues/271","repository_url":"https://api.github.com/repos/andrewgodwin/channels","labels_url":"https://api.github.com/repos/andrewgodwin/channels/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/andrewgodwin/channels/issues/271/comments","events_url":"https://api.github.com/repos/andrewgodwin/channels/issues/271/events","html_url":"https://github.com/andrewgodwin/channels/issues/271","id":167684492,"number":271,"title":"Session recovery on re-connect","user":{"login":"h3","id":102919,"avatar_url":"https://avatars.githubusercontent.com/u/102919?v=3","gravatar_id":"","url":"https://api.github.com/users/h3","html_url":"https://github.com/h3","followers_url":"https://api.github.com/users/h3/followers","following_url":"https://api.github.com/users/h3/following{/other_user}","gists_url":"https://api.github.com/users/h3/gists{/gist_id}","starred_url":"https://api.github.com/users/h3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3/subscriptions","organizations_url":"https://api.github.com/users/h3/orgs","repos_url":"https://api.github.com/users/h3/repos","events_url":"https://api.github.com/users/h3/events{/privacy}","received_events_url":"https://api.github.com/users/h3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/andrewgodwin/channels/labels/awaiting%20response","name":"awaiting response","color":"d4c5f9"},{"url":"https://api.github.com/repos/andrewgodwin/channels/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-26T19:00:03Z","updated_at":"2016-07-27T15:09:53Z","closed_at":null,"body":"Consider a frontend connected to the backend via websockets and the backend goes down for a couple of seconds.\r\n\r\nThe frontend can detect the disconnect and start trying to reconnect, that part is cake.\r\n\r\nHowever when the websocket connection is re-established, the session is gone. From what I understand, this occurs because the session is piggy backed on the HTTP request, which does not happen with subsequent socket connections.\r\n\r\nSo, is there anyway to recover a websocket connection *with* its session ? Or it's gone for good as soon as the socket is closed ?\r\n\r\nI did not find much in the documentation about this situation..\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/andrewgodwin/channels/issues/comments/235616268","html_url":"https://github.com/andrewgodwin/channels/issues/271#issuecomment-235616268","issue_url":"https://api.github.com/repos/andrewgodwin/channels/issues/271","id":235616268,"user":{"login":"h3","id":102919,"avatar_url":"https://avatars.githubusercontent.com/u/102919?v=3","gravatar_id":"","url":"https://api.github.com/users/h3","html_url":"https://github.com/h3","followers_url":"https://api.github.com/users/h3/followers","following_url":"https://api.github.com/users/h3/following{/other_user}","gists_url":"https://api.github.com/users/h3/gists{/gist_id}","starred_url":"https://api.github.com/users/h3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3/subscriptions","organizations_url":"https://api.github.com/users/h3/orgs","repos_url":"https://api.github.com/users/h3/repos","events_url":"https://api.github.com/users/h3/events{/privacy}","received_events_url":"https://api.github.com/users/h3/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T15:09:53Z","updated_at":"2016-07-27T15:09:53Z","body":"I'm sorry I was wrong.\r\n\r\nAfter a socket reconnect `ws_on_connect` indeed recovers the user session, but not the state data I attached to the session while `ws_on_message` lose the user _and_ the state data.\r\n\r\n"}}
{"actor":{"display_login":"h3"}}