Hey Branko I should thank you specifically for answering so many of my queries ... infact u have answered 2 all my posts ... so "Thanks a lot Branko" :)
There is one thing which I cant get .. could be my weak python ... m new 2 it also ... https://github.com/webpy/webpy/blob/master/web/session.py#L26 if I set the timeout to some value and the browser which created that cookie never visit me again still that cookie will be deleted after the said amount of time automatically or do I have to specifically write code for it. I need to know bcoz I dont want the datastore to get filled with useless sessions Cheers PK PS: Does HTH mean Happy to help On Jan 15, 6:18 pm, Branko Vukelić <[email protected]> wrote: > If you look at the source, you'll notice a few things. > > https://github.com/webpy/webpy/blob/master/web/session.py#L26https://github.com/webpy/webpy/blob/master/web/session.py#L75https://github.com/webpy/webpy/blob/master/web/session.py#L92https://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 > > athttp://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.
