session not stored

26 views
Skip to first unread message

kz kz

unread,
Apr 23, 2012, 8:04:51 PM4/23/12
to Google App Engine
When running the following code, a new session is generated every time
in development mode and when hosted in App Engine. When I try the code
in Tomcat, it works fine. Why isn't the code working correctly?

response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession(true);

if (session.isNew()) {
out.println("New session");
} else {
out.println("Old Session");
}

Simon Knott

unread,
Apr 25, 2012, 2:34:36 AM4/25/12
to google-a...@googlegroups.com
Hi,

Have you enabled sessions, through your app config file?  https://developers.google.com/appengine/docs/java/config/appconfig#Enabling_Sessions

Cheers,
Simon
Reply all
Reply to author
Forward
0 new messages