request.getSession().setAttribute("UserName", username);
that value will be accessible for multiple requests by this browser.Note that session support is something that is done per-runtime and per-framework,
but most if not all of them include it as it is indeed a basic feature of a web server. Part of the Bookshelf tutorial deals with using sessions.
On Monday, October 30, 2017 at 3:30:28 AM UTC-4, Joshua Fox wrote:What is the recommended way to do Session Management on Google Application Engine?In the webapp world, the usual implementation with a session store (Redis/Memcache/RDBMS etc) that is shared by all server-instances.So, when the Java code callsthat value will be accessible for multiple requests by this browser.request.getSession().setAttribute("UserName", username);
A websearch shows some advice:
- Implement it yourself
- Various open-source libraries, non-standard and mostly unmaintained
I would expect a PaaS like GAE to have Session Management out-of-the-box.This StackOverflow answer says "AppEngine uses Datastore to store the session informations and memcache for faster access" and this official documentation mentions that "Session data is always written synchronously to memcache."
But on the other hand this tutorial suggests that session management must be added to GAE.How should we do Session Management?
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/764e06ad-4d90-45bd-8bcd-e801913976a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/87537ad8-948e-46cc-8e6d-4945e10604ad%40googlegroups.com.
Hi Joshua,For App Engine Standard:Take a look at the appengine-web.xml reference. Specifically async-session-persistence, sessions-enabled,I'm out for 3 weeks this month, but hope to review and fix all the Java Bookshelfs in early December. If there are other areas that you think they don't meet expectations, please let me know.Regards,Les
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CAGB1p5gW0J1u79M4M3KNk91eTz-gNJK%3DigK5GC_vHXe52HNqPQ%40mail.gmail.com.
Les, thank you,I see that it> stores session data in the App Engine datastore for persistence, and also uses memcache for speedis this accessible, as would normally be true with Java appservers, through req.getSession().setAttribute(...) even when unauthenticated? In other words, one can use this even without using the Google App Engine Users API (if we are implementing our own user management).
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CAD%3DB7cOv8KXigkVJhEYmRp-3DW0R1kU%3DyCpLqZ25iVALOfxgdA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CAGB1p5g%3DdLYDeME%2BTBV8fTBxe-JQiu2ceoVXAVUM8A-%2BhBTiSg%40mail.gmail.com.