Ensure temporary sessions are replaced by authenticated sessions
Closes #12: added WebSocket support