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
On Sat, 2002-05-18 at 15:07, alan runyan wrote:
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
What about session_data.items()? The TransientDataContainer that is the "session_data" object supports most methods that dictionaries do (keys(), values(), etc). The interfaces that the sessioning interfaces support are documented in the help system.
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?
Transience.TransientObject is where you probably want to look. HTH, - C
On Sat, 2002-05-18 at 15:07, alan runyan wrote:
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
What about session_data.items()? The TransientDataContainer that is the "session_data" object supports most methods that dictionaries do (keys(), values(), etc). The interfaces that the sessioning interfaces support are documented in the help system.
I'm a freakin moron. I was using ZEO. of course one ZEO client cant access another ZEO clients session data.
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?
Transience.TransientObject is where you probably want to look.
yup. I was looking at this. but my advanced configuration is too advanced for such a small brain as mine. ~runyaga
On Sat, 2002-05-18 at 20:35, alan runyan wrote:
I'm a freakin moron. I was using ZEO. of course one ZEO client cant access another ZEO clients session data.
Oh ok. That's understandable. If you really want to do this, you could, though... it a "transient object container" (e.g. session data container) can be added to the "main" storage or to a mounted storage instead of kept in the temp_folder. HTH, - C
Chris McDonough wrote:
Oh ok. That's understandable. If you really want to do this, you could, though... it a "transient object container" (e.g. session data container) can be added to the "main" storage or to a mounted storage instead of kept in the temp_folder.
Is there a How-To for this? How would storing sessions in this way impact ZODB/ZEO performance? cheers, Chris
On Sun, 2002-05-19 at 06:59, Chris Withers wrote:
Chris McDonough wrote:
Oh ok. That's understandable. If you really want to do this, you could, though... it a "transient object container" (e.g. session data container) can be added to the "main" storage or to a mounted storage instead of kept in the temp_folder.
Is there a How-To for this?
Sort of... these might help.. http://www.zope.org/Members/mcdonc/HowTos/UseExternalMountWithCST http://www.zope.org/Members/jgrewen/ZEO%20with%20CoreSessionTracking%20and%2...
How would storing sessions in this way impact ZODB/ZEO performance?
You'll unfortunately need to find that out yourself, I've not tried it... - C
Chris McDonough wrote:
How would storing sessions in this way impact ZODB/ZEO performance?
You'll unfortunately need to find that out yourself, I've not tried it...
If I find out, I'll stick results somewhere... thanks for the links :-) cheers, Chris
participants (3)
-
alan runyan -
Chris McDonough -
Chris Withers