durusmail: quixote-users: SessionManager poll: transactions.
SessionManager poll: transactions.
2005-05-25
2005-05-27
2005-05-27
SessionManager poll: transactions.
Frederic Peters
2005-05-27
Titus Brown wrote:

> still thinking about sessions.  Does anyone out there use the
> SessionManager.abort_changes & SessionManager.commit_changes
> functionality?  If so, I'd be interested in hearing from you
> privately; I'm particularly interested in what backend storage
> systems you're using.

Not privately, as requested later :)

I probably should introduce myself since it is my first post.  I have
been using Quixote for something like three weeks now and I am really
happy about the experience.

Much like everybody I needed persistent sessions :) and subclassed
SessionsManager to get them.  My scheme was only supposed temporary
and is somewhat hackish.  I have a directory (whatever/sessions/) and
I use pickle to read/write session objets to that directory, one file
per session, the name being session_id.

So I subclassed SessionsManager and added keys(), values(), items,
has_key(), __setitem__(), __getitem__(), __delitem__() to get proper
dictionary behaviour (as you wrote "this makes subclassing a bit
annoying") and commit_changes() which writes down the file on disk.

I then have a direct call to this method to alter user sessions from
SOAP messages[1].  For the record I believe your SessionStore ::
save_session() would fit this usage.


Regards,

        Frederic

[1] this is to implement a part of the Liberty Alliance single sign on
    specifications; http://projectliberty.org/.
reply