Re: Who is logged in??

"Jonathan Ellis" <[email protected]> Tue, 26 Jun 2007 10:23:48 -0700
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
On Tue, 26 Jun 2007 12:45:27 -0400, "Christopher Clarke"
<cclarke-wYfHrJ5eQDBWk0Htik3J/[email protected]> said:
> In switching to the login tag i was attempting to access the session  
> from the config.py
> But i just colud not get a handle on it (the session that is).
> I've tried
> session['user_data'] = udata #udata is a dict of user attributes
> It appears to work but when  i try to access this from the page i get  
> an invalid key error
> I've used the session in my active handlers by using api.session
> how do i and set session variable from config.py>>

You can't, there's no active session there, sessions are per request. 
What is the active request in config.py?  There is none.

> In any case is this the best way to achieve what i am trying to do???

Most frameworks do this by putting session data in a database and
querying that.  So you could either write a DB session backend and do
that, or you could use os.stat on the session files generated by the
existing FS-based backend to get the mtimes.

-Jonathan

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/