Issue 41 in gaeutilities: Session mysteriously stops

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 2, 2009, 5:25:33 PM10/2/09
to appengine...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 41 by brianmh...@gmail.com: Session mysteriously stops
http://code.google.com/p/gaeutilities/issues/detail?id=41

What steps will reproduce the problem?

This is oversimplified, but essentially:

1. In Django Create a session likeso:

from appengine_utilities import sessions

Here is a Django view

def signin(request):
request.session = sessions.Session()
request.session['person'] = 'identity'

There are other views that access request.session['person'], e.g.:

def do_something(request):
return HttpResponse("Person: %s" % request.session['person'])

2. View a page or two within the next 30 seconds to 2 minutes, and
request.session data will be {'person':'identity'}. Sometimes the
request.session data lasts for an hour. Other times it disappears after
seconds.

3. Mysteriously request.session becomes {}

What is the expected output? What do you see instead?

I would expect that request.session would not lose its information.

What version of the product are you using? On what operating system?

- Gae Utilities 1.3
- GAE Dev. 1.2.5 SDK
- Django 1.0 (from get_version())

Please provide any additional information below.

I note that after the session has disappeared _AppEngineUtilities_Session
in GAE datastore contains a sid equal to the value of a
gaeutilities_session cookie. There is nothing else in the datastore (i.e.
no _AppEngineUtilities_SessionData)

I'm afraid I'm just not using gaeutilities sessions properly, but I've
tried everything I can think of so I think there is still something amiss,
here.

Is there any more information I could provide that may be of assistance?

Thank you.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Oct 4, 2009, 12:17:03 AM10/4/09
to appengine...@googlegroups.com

Comment #1 on issue 41 by bowman.joseph: Session mysteriously stops
http://code.google.com/p/gaeutilities/issues/detail?id=41

Session, by default, relies on the cookie, ip address, and user agent of
the browser
to persist. I have seen cases where the local development server, on
restart, will
lose the session. Is this what is going on, or are you experiencing this on
the live
server?

You can try turning off user agent checking and ip checking in the settings
file to
see if that helps. You can also turn the clean check percent to 0, and
track your
cookies in your browser on each request to see if you can figure out where
it's being
dropped. The reason you're only seeing one session is it's highly likely
any expired
session is getting deleted.

Lastly, do you have a lot of AJAX requests going on your page? The 3 token
system
should be fine with this, but just a thought.

codesite...@google.com

unread,
Oct 4, 2009, 6:42:09 PM10/4/09
to appengine...@googlegroups.com

Comment #2 on issue 41 by brianmh...@gmail.com: Session mysteriously stops
http://code.google.com/p/gaeutilities/issues/detail?id=41

Thank you for the response and suggesting places to look. It looks like the
session
is lost whenever I make changes to my application, which is running on the
development server (GAE 1.2.5).

Since my session is keeping the login credentials (i.e. OpenID), it looks
like I may
have to create a session driver (i.e. a faux session) while I'm developing,
or log in
every time I make a change.

Although those workarounds will work, I'd also be much obliged if you
happened to
have any suggestions for keeping sessions across restarts (during the
development
process).

Reply all
Reply to author
Forward
0 new messages