Code help plz...

0 views
Skip to first unread message

app engine dude

unread,
Mar 9, 2009, 1:39:45 AM3/9/09
to appengine-utilities
plz help me with the code any one..

Iam using sessions for storing username and place information.

My app uses parallel entry ie., the user goeson entering data. the
username remains the same but city might change.
the session code i used is...

self.session['username']=username
self.session['place']=place

so when i need to retreive i just use

user=self.session['username']
place=self.session['place']

this works fine with my application.Now, my application has numerous
pages. The users go though the pages.so how do i check the session has
expired or not. if expired how i have to get back to login page.Also i
dont understand few things when i see my database table
_AppEngineUtilities_Session online...like..initially when i login only
one sid is created, but later 3 sids are seen in the list...plzz help
me out.

Joe Bowman

unread,
Mar 9, 2009, 8:47:13 AM3/9/09
to appengine-utilities
To see if a session is expired, set a key/value in the session when
the user logs in. If you're setting their username when they log in,
then you only need to check something like

if self.session.has_key('username'):

That will tell you if they've logged in. If they haven't logged in
with that session then that value won't be set.

I'd need more information about the multiple sessions you are seeing.
Are they all from the same ip? Session works by comparing against a
cookie in the browser, and optionally (but set on by default) the ip
and user agent.
Reply all
Reply to author
Forward
0 new messages