With Play 1.0 we had the session.getId() method to retrieve a unique session identifier.
The id was handy to prefix keys in the global cache.
Where is Play 2.0 session.id equivalent ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since the session data is stored as cookies, there is no more session id with play 2.0. In fact there is no need for an identify token either, the session data is just passed along with every request leaving the server completely stateless.
However, you may still need an id should you need to store per user data in the global cache.
For this purpose, use the code below
Session id? it sounds so Java EE anyways…