How is the session id maintained in Play 2.0

1,101 views
Skip to first unread message

Maxime Lévesque

unread,
Feb 14, 2012, 3:53:52 PM2/14/12
to play-fr...@googlegroups.com

Hi, I'd like to know the approached used by play in order to be secure and stateless.
I suppose that it has to be done by applying proper cryptography techniques
to a session Id cookie. Is there some doc on this, or perhaps some code ?

if the strategy differs in play1 or play2, I'm more interested in play 2.0

Thanks


Guillaume Bort

unread,
Feb 15, 2012, 6:48:09 AM2/15/12
to play-fr...@googlegroups.com
The session content is not kept on server side, and is just serialized
to a Session Cookie. This cookie is signed with the secret application
key using HMAC-SHA1

2012/2/14 Maxime Lévesque <maxime....@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/XJm_iHhJ0SIJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

--
Guillaume Bort

Meglio

unread,
Feb 25, 2012, 5:13:29 PM2/25/12
to play-fr...@googlegroups.com

There is no technical timeout for the Session. It expires when the user closes the web browser. 

How can I change session expiration time?
I want to keep user signed in for many days, but if I'll lose cookies once browser closed,
how can I implement authorization for something like 2 weeks or so?

Tom Bocklisch

unread,
Feb 27, 2012, 6:26:03 AM2/27/12
to play-framework
You can't implement long-living sessions without cookies. Without
them you are not able to verify clients. Therefore you are lost if the
client deletes all his cookies when closing the browser.

The current session cookie does not set any expiration, so it defaults
to "session". As far as I know there is currently no support for
changing this expiration via settings.
Reply all
Reply to author
Forward
0 new messages