From ff1c071486dfc7e5d3b11be79e6589d11591970b Mon Sep 17 00:00:00 2001 From: sidya82 Date: Mon, 3 Mar 2014 18:49:35 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20supe?= =?UTF-8?q?rTornado.py=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20v/vide?= =?UTF-8?q?o.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- superTornado.py | 6 +++--- v/video.html | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/superTornado.py b/superTornado.py index 1a6d7ce..83ad2cc 100644 --- a/superTornado.py +++ b/superTornado.py @@ -45,7 +45,7 @@ class MainHandler(BaseHandler): log.printL('maison = httplib.HTTPConnection("192.168.16.150", 80)',10) self.set_secure_cookie("user", iden) if autorise == True: - self.set_secure_cookie("user", iden) + self.set_secure_cookie("user", iden,1) self.redirect("/video") else: log.printL("->An unauthorized user try to access : " + self.request.remote_ip,30) @@ -65,7 +65,7 @@ class UnauthorizedHandler(BaseHandler): def post(self): force = self.get_argument("illegalAccess","") if force == "1" : - self.set_secure_cookie("user", "IllegalUser") + self.set_secure_cookie("user", "IllegalUser",1) self.redirect("/video") else : self.redirect("/") @@ -119,7 +119,7 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): else: log.printL('->Send visual alarm deconnection user',20) log.printL('maison.request("GET", "micom/lamp.php?room=salon1&order=0")',10) - print"->"+iden+" Deconnection : " + self.request.remote_ip + log.printL"->"+iden+" Deconnection : " + self.request.remote_ip def send_image(self) : diff --git a/v/video.html b/v/video.html index f39cdc2..e78f8dd 100644 --- a/v/video.html +++ b/v/video.html @@ -21,6 +21,7 @@ } ws.onopen = function () { console.log("websocket engage"); + document.cookie = encodeURIComponent("user") + "=deleted; expires=" + new Date(0).toUTCString(); }; ws.onclose = function () { console.log("connection closed");