# Session configuration
# ~~~~~~~~~~~~~~~~~~~~~~
# By default, session will be written to the transient PLAY_SESSION cookie.
# application.session.cookie=PLAY
application.session.maxAge=30mn
or
application.session.maxAge=1h
or whatever value you like
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> 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.
>
It sounds like you are thinking of how most servlet containers handle sessions by default.
Linc.
trait Secured {
def Authenticated[A](p: BodyParser[A])
(f: Outcome[A] => SimpleResult)(implicit group: RoleGroup): Action[A] = {
def verify(id: Int)(implicit r: Request[A]): SimpleResult = {
Cache.orElse("roles."+id, 300){ repo.userrole.findAllByUser(id) }.filter{
x=> x.active && x.roleGroup == group)
}.map{ f(toOutcome(r, id)) }.getOrElse(toFail)
}
Action(p) { implicit r=>
r.session.get("uid").map(verify(_.int)).getOrElse(onFail)
}
}
}
object MembersOnly extends Controller {
def privatePlace = Authenticated { implicit r=>
// if we got here account is active
...
}
}