diff --git a/appServer.go b/appServer.go index 30f6fa5..02b2f78 100644 --- a/appServer.go +++ b/appServer.go @@ -269,14 +269,7 @@ func (app *application) socketReader(bridge *wsBridge) { ErrorLog(`"session" key not found`) } - answer := "" - if session, answer = app.startSession(obj, events, bridge, nil); session != nil { - if !bridge.writeMessage(answer) { - return - } - session.onStart() - go sessionEventHandler(session, events, bridge) - } + bridge.writeMessage("restartSession();") default: if !session.handleAnswer(command, obj) { diff --git a/app_scripts.js b/app_scripts.js index 856ffce..21d283c 100644 --- a/app_scripts.js +++ b/app_scripts.js @@ -73,6 +73,10 @@ function sessionInfo() { return message + "}"; } +function restartSession() { + sendMessage( sessionInfo() ); +} + function getIntAttribute(element, tag) { let value = element.getAttribute(tag); if (value) {