comparison src/server/session_iface.py @ 1090:9c41b7e91172

server: set jid and started time in session on log-in: session make the difference between local libervia session ("started"), and backend session ("backend_started")
author Goffi <goffi@goffi.org>
date Fri, 01 Jun 2018 12:55:25 +0200
parents c2037b44f84e
children eda7a1c6532a
comparison
equal deleted inserted replaced
1089:3996acd7c796 1090:9c41b7e91172
19 from zope.interface import Interface, Attribute, implements 19 from zope.interface import Interface, Attribute, implements
20 from sat.tools.common import data_objects 20 from sat.tools.common import data_objects
21 from libervia.server.constants import Const as C 21 from libervia.server.constants import Const as C
22 import os.path 22 import os.path
23 import shortuuid 23 import shortuuid
24 import time
24 25
25 FLAGS_KEY = '_flags' 26 FLAGS_KEY = '_flags'
26 27
27 class ISATSession(Interface): 28 class ISATSession(Interface):
28 profile = Attribute("Sat profile") 29 profile = Attribute("Sat profile")
35 implements(ISATSession) 36 implements(ISATSession)
36 37
37 def __init__(self, session): 38 def __init__(self, session):
38 self.profile = None 39 self.profile = None
39 self.jid = None 40 self.jid = None
41 self.started = time.time()
42 # time when the backend session was started
43 self.backend_started = None
40 self.uuid = unicode(shortuuid.uuid()) 44 self.uuid = unicode(shortuuid.uuid())
41 self.identities = data_objects.Identities() 45 self.identities = data_objects.Identities()
42 self.csrf_token = unicode(shortuuid.uuid()) 46 self.csrf_token = unicode(shortuuid.uuid())
43 self.pages_data = {} # used to keep data accross reloads (key is page instance) 47 self.pages_data = {} # used to keep data accross reloads (key is page instance)
44 48