If you look at the source, you'll notice a few things.

https://github.com/webpy/webpy/blob/master/web/session.py#L26
https://github.com/webpy/webpy/blob/master/web/session.py#L75
https://github.com/webpy/webpy/blob/master/web/session.py#L92
https://github.com/webpy/webpy/blob/master/web/session.py#L148

HTH

On Sat, Jan 15, 2011 at 12:47 PM, Dexter <[email protected]> wrote:
> One more doubt about sessions & there is no documentation for it or I
> could not find it
>
> In short
> How do we handle session expiry
>
> In Long
> Now that I am using sessions with appengine I have used yejun's
> version of session.py
> https://github.com/yejun/webpy/blob/GAE/web/session.py
> it allows you to use Google datastore for maintaining the session
> info ... so I create a session and it will store some data in the
> datastore. Now the question is how exactly this session would
> expire ... going thru the session.py code was helpful but I think some
> more external help would be gr8
>
> So do we need to have a cron type job to periodically remove the old
> sessions from the datastore or is there some inbuilt mechanism built
> into the session.py to handle it. (I know there is inbuilt code in
> session.py to do it .. just not sure how exactly to do it)
>
> Thanks & Regards
> PK
>
>
> On Jan 14, 11:20 pm, Dexter <[email protected]> wrote:
>> Thanks Branko ...
>>
>> this is how I got it working ... Lemme kno if this is the best
>> practise
>>
>> foo1.py
>>             session = web.session.Session(app)
>>             web.config._session = session
>>             session.attr = someinput
>>
>> foo2.py
>>         if web.config.get('_session') is None:
>>             return "No Session"
>>         else:
>>             session = web.config._session
>>             return some_function(session.attr)
>>
>> The key info which I was looking for was which parameter to set and
>> how to read it
>> and the answer which I got is
>> parameter to be set is
>> web.config._session = session
>>
>> It can be read by any other app using session = web.config._session.
>> The web.config.get('_session') becomes a handy tool to check if no
>> session is present.
>>
>> On Jan 14, 10:54 pm, Branko Vukelić <[email protected]> wrote:
>>
>> > Also keep in mind that sessions don't play nice with the reloader. But
>> > reloader doesn't work that well anyway (didn't last time I tried
>> > anyway), so you might want to turn it off.
>>
>> > 2011/1/14 Branko Vukelić <[email protected]>:
>>
>> > > You use sessions so you don't have to use cookies. The session library
>> > > should set up a cookie for you, and all you have to worry about is
>> > > sessions and data in it.
>>
>> > --
>> > Branko Vukelic
>>
>> > [email protected]http://www.brankovukelic.com/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/webpy?hl=en.
>
>



-- 
Branko Vukelic

[email protected]
http://www.brankovukelic.com/

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to