[Zope] exploring sessions

alan runyan alan runyan" <runyaga@runyaga.com
Sat, 18 May 2002 14:07:12 -0500


one of the most common requests now a days (I've gotten over 10 requests in
the past 3 days) is to provide PostNuke-like functionality that says:
x registered users are online
y anonymous users.

of course this information is calculated using SESSIONS.

I've only used SESSIONS for limited things.  Now I'm trying to answer these
peoples questions.
And its pretty frustrating.  I think I'm looking in the right place. but
continually get nothing.
here is my function that I am assuming would return *all* session
information currently.

I'm using Python2.1.3 w/ Zope2.5.1

sessions=app.temp_folder.session_data
trees = [item[0] for item in sessions._ring]
print [len(tree.keys()) for tree in trees] #always gives me 0 for each key

also.. something strange.. [item[1] for item in sessions._ring] does not
return any id that are present
when I say (in a Python Script)

print context.REQUEST.SESSION
return printed

I see an id but its much longer than any of the ones in the print [item[1]
for item in sessions._ring] statement.
I am exploring SESSIONS using interactive python.  I also dont see where
context.REQUEST.SESSION.set('somekey', 'some value') is done --
where in the source is this actually done?

~runyaga