[albatross-users] Finding Saved Values in Sessions

Mike Barrett mike at daboyz.org
Sun Aug 18 18:07:49 EST 2002


    Howdy.  I'm trying to use albatross for a web application that I'm writing.
I'm just starting to get into it however, and I already have a question:

    How can I check to see if a value is stored in a session?  For example when
someone logs in to my application I have it store the loginName in the session.

    What I want to do is have the application check to see if that key/value is
stored in the session.  I tried doing it this way:

    ctx.locals.isAuthenticated = ctx.decode_session(ctx.app.get_session(ctx.sesid())).kas_key('loginName')

    But it doesn't seem to work.  Some other things:

    # This seems to work, it returns the session id.
    ctx.locals.sesid = ctx.sesid()

    # This doesn't seem to work.  It returns 'None'
    ctx.locals.blah = ctx.app.get_session(ctx.sesid())


    Any idea how I can make this work?  I'm using the ModularSessionFileApp and
    SessionFileAppContext modules.

    Thanks for any help you can give me. :)

-- 
     ________________________________________________________________________
                Mike Barrett | "I used to read, now I go to raves."
             mike at daboyz.org | -- Random MUNI Rider, speaking
              www.daboyz.org |    to my friend Allison.
     ------------------------+-----------------------------------------------



More information about the Albatross-users mailing list