Update of /cvsroot/webware/Webware/WebKit
In directory usw-pr-cvs1:/tmp/cvs-serv25076
Modified Files:
Session.py
Log Message:
use new MiscUtils.Funcs.uniqueId() to make session id harder to guess
Index: Session.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Session.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Session.py 2001/10/25 05:44:10 1.17
--- Session.py 2001/11/12 12:33:34 1.18
***************
*** 1,4 ****
from Common import *
! import whrandom
from time import localtime, time
--- 1,4 ----
from Common import *
! from MiscUtils.Funcs import uniqueId
from time import localtime, time
***************
*** 48,52 ****
attempts = 0
while attempts<10000:
! self._identifier = string.join(map(lambda x: '%02d' % x, localtime(time())[:6]), '') + str(whrandom.randint(10000, 99999))
if not trans.application().hasSession(self._identifier):
break
--- 48,52 ----
attempts = 0
while attempts<10000:
! self._identifier = string.join(map(lambda x: '%02d' % x, localtime(time())[:6]), '') + '-' + uniqueId(self)
if not trans.application().hasSession(self._identifier):
break
|