Paul
Paul

Reputation: 1

How to use Session on Google app engine

I do not know how to use Session on Google app engine. Please tell me. Thanks.

Upvotes: 0

Views: 2314

Answers (2)

App Engine includes an implementation of sessions, using the servlet session interface. The implementation stores session data in the App Engine datastore for persistence, and also uses memcache for speed. As with most other servlet containers, the session attributes that are set with session.setAttribute() during the request are persisted at the end of the request.

This feature is off by default. To turn it on, add the following to appengine-web.xml:

<sessions-enabled>true</sessions-enabled>

Upvotes: 1

yonran
yonran

Reputation: 19134

Are you talking about request.getSession() in the Java Servlet API? You have to enable sessions before that will work. See this question for more info on using HttpSession. By the way, you should probably tag your questions with the App Engine variant you're using (java or python).

Upvotes: 3

Related Questions