Creating Session on demand

18 views
Skip to first unread message

Miguel Hernández

unread,
Sep 29, 2011, 7:49:44 PM9/29/11
to gae-sessions
Hi guys,

If I understand correctly the installation of gae-sessions is
application wide and every request to my application will create a new
session (if doesn't exist already).

Is there a way to initialize sessions on demand on certain
RequestHandlers only? Also will this enable me to use different
timeouts and settings (like cookie_t

David Underhill

unread,
Oct 11, 2011, 6:06:00 AM10/11/11
to gae-sessions
Hi Miguel,

A Session object is created for every request, but this doesn't result
in any extra data being stored or any cookie data being sent to the
client if you don't change the Session object.

The overhead for creating the Session object is tiny (even if session
data is present in cookies sent to the server, it is lazily loaded
when you actually access the session - not when it is created) so I
wouldn't worry about the Session object being created (in memory) for
each request.

~ David
Reply all
Reply to author
Forward
0 new messages