Implementation of session over websockets