简体   繁体   中英

How to use Session on Google app engine

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

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).

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM