Newbie question--help

0 views
Skip to first unread message

app engine dude

unread,
Mar 4, 2009, 5:33:26 AM3/4/09
to appengine-utilities
hi,

Iam developing an app that has session management included.My page has
login for vieing the main page.after checking the login it sets the
session like this

self.session = Session()
self.session['username']=username

while retriving the session variable it is done like this...

self.session = Session()
user=self.session['username']

This works fine...but some times...there was an error being displayed
as...

'username'
Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 501, in __call__
handler.get(*groups)
File "/base/data/home/apps/****/
1.331808180605034694/21_test_demo.py", line 190, in get
user=self.session['username']
File "/base/data/home/apps/****/1.331808180605034694/
appengine_utilities/sessions.py", line 396, in __getitem__
raise KeyError(str(keyname))
KeyError: 'username'

**** corresponds to my app name...

plz hep me out with this...

Thanx in advance.

Joe Bowman

unread,
Mar 4, 2009, 8:59:19 AM3/4/09
to appengine-utilities
So, you're getting that error when you attempt to write the session
data? What version are you using?

app engine dude

unread,
Mar 4, 2009, 11:44:17 AM3/4/09
to appengine-utilities
Nope...Its not every time. Only few times the error appears.I dont
know why...

Joe Bowman

unread,
Mar 4, 2009, 12:41:05 PM3/4/09
to appengine-utilities
I'd first upgrade to the latest version, 1.2. Judging by the error
string you're using an older version of the session class.

app engine dude

unread,
Mar 4, 2009, 12:57:17 PM3/4/09
to appengine-utilities
kk...i would upgrade my version and try if da same happens.....i would
report it if i get it back.
thanq 4 da response.
Reply all
Reply to author
Forward
0 new messages