[Zope] Session Management
Pavlos Christoforou
pavlos@gaaros.msrc.sunysb.edu
Tue, 4 Jan 2000 21:14:22 -0500 (EST)
On Wed, 5 Jan 2000, Anthony Baxter wrote:
>
> Ah - so rather than calling the session object, then looking up in
> REQUEST.SESSION, you just look up in the session object?
Basially yes.
>
> Would it be possible to support both of these methods of operation?
> If you call the session object, it creates REQUEST.SESSION. If you
> call it's __getitem__ type methods, it does it directly.
Ok but what about the options to the __call__ method? Maybe they should be
looked up in the REQUEST object like _force_new_session.
>
> Fair enough - I'm suprised that it's getting used that much, I only added
> SESSION.getName() in the last release (there'd been no requests for it
> before then). Is this for the session-in-url thing?
Yes and also for inclusion in forms as a hidden variable.
>
> I originally looked at marshal - but one of the earlier things I wanted
> to cache in a session was the result of an sql method. therefore I went
> with pickle over marshal. I'm also not convinced that the pickle/marshal
> difference isn't going to just be miniscule compared to the time to pull
> the session data off disk, or out of a DB - in general we're talking
> really small things.
Ok I will switch to cPickle. I did not think about SQL methods return
results. I rarely need to cache non marshalable objects
but obviously experiences vary :-)
I think we have a plan. I will probably take both sources, SQLSession and
FSSession and try to merge them and abstract out the storage details so we
can have a sort of Generic Session Manager or something.
Pavlos