Hello,
I posted this on Stack Overflow yesterday, but I didn't any responses.
Maybe you guys could help me out?
I am trying to create a new session in the Play 2.0, but it doesn't
seem to stick.
After getting an OpenID result, I want to redirect them back to the
index (for now, anyway), along with the OpenID information they just
got back.
Redirect(routes.Application.index).withSession(
"id" ->
info.id,
"email" ->
info.attributes.get("email").getOrElse("
unk...@unknown.com"),
"timestamp" -> (System.currentTimeMillis() /
1000L).toString)
This calls the following function:
def index = Action { implicit request =>
Ok(html.index(request))
}
However, the implicit request, according to Eclipse, has null cookies,
and a null session. What's going on here?
If it helps, this is the full function that the OpenID information
comes from:
def openIDCallback = Action { implicit request =>
AsyncResult(
OpenID.verifiedId.extend(_.value match {
case Redeemed(info) => {
Redirect(routes.Application.index).withSession(
"id" ->
info.id,
"email" ->
info.attributes.get("email").getOrElse("
unk...@unknown.com"),
"timestamp" -> (System.currentTimeMillis() /
1000L).toString)
}
case Thrown(t) => {
// Here you should look at the error, and give feedback to
the user
Redirect(routes.Application.index)
}
}))
}
Thanks!