equal
deleted
inserted
replaced
28 from logging import getLogger |
28 from logging import getLogger |
29 from time import time, clock |
29 from time import time, clock |
30 from itertools import count |
30 from itertools import count |
31 from warnings import warn |
31 from warnings import warn |
32 from os.path import join |
32 from os.path import join |
|
33 from uuid import uuid4 |
33 |
34 |
34 from logilab.common.logging_ext import set_log_methods |
35 from logilab.common.logging_ext import set_log_methods |
35 from logilab.common.decorators import monkeypatch |
36 from logilab.common.decorators import monkeypatch |
36 from logilab.common.deprecation import deprecated |
37 from logilab.common.deprecation import deprecated |
37 |
38 |
244 # identifier, but may later differ in case of auto-reconnection as done |
245 # identifier, but may later differ in case of auto-reconnection as done |
245 # by the web authentication manager (in cw.web.views.authentication) |
246 # by the web authentication manager (in cw.web.views.authentication) |
246 if cnx is not None: |
247 if cnx is not None: |
247 self.sessionid = cnx.sessionid |
248 self.sessionid = cnx.sessionid |
248 else: |
249 else: |
249 self.sessionid = None |
250 self.sessionid = uuid4().hex |
250 |
251 |
251 @property |
252 @property |
252 def anonymous_session(self): |
253 def anonymous_session(self): |
253 return not self.cnx or self.cnx.anonymous_connection |
254 return not self.cnx or self.cnx.anonymous_connection |
254 |
255 |