Enabling sessions on all page accesses is probably ok (although it will likely slow things down for pages that don't really need a session to render). I dont understand the Postgres usage here, but I probably don't have to. ;-) The sessioning Transience product has been essentially rewritten to address the KeyError problem you're seeing. It's available in Zope 2.6 or the Zope trunk. It can also replace the existing Transience product in Zope 2.5 if you'd rather do that. You can download a tarball from http://cvs.zope.org/Products/Transience/Transience.tar.gz?tarball=1. Back up your database, replace the lib/python/Products/Transience directory with the contents of the unpacked Transience tarball, and restart Zope. ----- Original Message ----- From: "Bakhtiar A Hamid" <bak@nstp.com.my> To: <zope@zope.org> Sent: Sunday, July 14, 2002 9:36 PM Subject: [Zope] zope and session i'd like to do some brain picking with regards to zope and session currently, i'm enabling session on all pages by using script python [1]. it works ok, but is that the right way of doing it? and i sometimes get keyerror[2] also, when enabling sessions, can i get to the data stored in transient object so that i can, say, see how many people are currently in session, etc, etc. what i'm doing now is storing some of this stuff in postgresql, which is wrong, i think. thanks for all input --[1]script python--- session = context.REQUEST.SESSION browsermgr = session.getBrowserIdManager() r=context.REQUEST if session.getBrowserIdManager().isBrowserIdNew(): session.set(browsermgr.getBrowserIdName(),browsermgr.getBrowserId()) r.set(browsermgr.getBrowserIdName(),browsermgr.getBrowserId()) context.q_add_user_session(context, r)#update postgresql to get who's in session else: if _.SecurityGetUser().getUserName() != 'Anonymous User': r.set(browsermgr.getBrowserIdName(),browsermgr.getBrowserId()) context.q_update_user_session(context, r)#update postgresql to get who's in session --keyerror [2] (Object: session_data) KeyError: duplicate key 08694963A0YdxjlmPiI -- -- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org How can I laugh tomorrow, if i can't even smile today. _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )