I have this code that works just fine on the development server but when I deploy the application, the session isn't created. What am I doing wrong?
HttpSession session = req.getSession(true); session.setAttribute("loggedIn", new String("true"));
Edit:
The sessions are enabled. What I realized now is that the _ah_SESSION variable is not being created, not even on the development server (although it works).
Did you enable sesssion in APE. See instructions here,
http://code.google.com/intl/en-US/appengine/docs/java/config/appconfig.html#Enabling_Sessions
您可以通过以下方法在GAE中获取会话:
this.getThreadLocalRequest().getSession();
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.