[Zope] sessions and zope2.6.0

Bakhtiar A Hamid kedai@kedai.com.my
Tue, 22 Oct 2002 09:33:25 +0800


hi all
i have this "key error" with sessions, that really shows itself with zope=
2.6.0

previously, with 2.5.1, and 2.6.0b1, i got key error only when i tried=20
iterating thru the Trancient Object (temp_folder/session_data)

now, with 2.6.0, it seems i get this error even when setting/reading sess=
ions. =20
this, however does not mean that this happens everytime.  it's a bit=20
unpredictable.  last time, i can still reset the Transient Object.  nowi =
=20
have to reset zope since i cannot get to the=20
temp_folder/session_data/manage_workspace

the relevant traceback is attached[1].  the relevant script (python)[2]

tb[1]
Traceback (innermost last):
  Module OFS.SimpleItem, line 201, in raise_standardErrorMessage
  Module OFS.DTMLMethod, line 126, in __call__
  Module DocumentTemplate.DT_String, line 474, in __call__
  Module OFS.DTMLMethod, line 119, in __call__
  Module DocumentTemplate.DT_String, line 474, in __call__
  Module DocumentTemplate.DT_Util, line 201, in eval
   - __traceback_info__: sc_def_session_val
  Module <string>, line 2, in f
  Module Shared.DC.Scripts.Bindings, line 252, in __call__
  Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 315, in _exec
  Module Script (Python), line 1, in sc_def_session_val
   - <PythonScript at /kk/sc_def_session_val used for /kk/kk>
   - Line 1
  Module ZPublisher.HTTPRequest, line 1189, in __getattr__
  Module ZPublisher.HTTPRequest, line 1149, in get
  Module Products.Sessions.SessionDataManager, line 93, in getSessionData
  Module Products.Sessions.SessionDataManager, line 180, in=20
_getSessionDataObject
  Module Products.Transience.Transience, line 175, in new_or_existing
  Module Products.Transience.Transience, line 786, in get
  Module Products.Transience.Transience, line 599, in _getCurrentBucket
  Module Products.Transience.Transience, line 688, in _housekeep
KeyError: 1035186480
------

[2]
session =3D context.REQUEST.SESSION
r=3Dcontext.REQUEST
s_obj =3D session.get('username',None)

if s_obj is None:
  session.set('username',_.SecurityGetUser().getUserName())

--=20

=09http://www.kedai.com.my/             http://www.kedai.com.my/eZine
=09http://www.zope.org/Members/kedai    http://www.my-zope.org
=09If you SMELLLL...=20