3
我使用播放框架添加了會話。會話工作正常,但註銷頁面重定向到索引頁面(登錄頁面)後,點擊後退或前進按鈕再次進入主頁面。我已經開始註銷的新會話,然後它也進入homw頁面。如何顯示相同的索引頁面後退或前進按鈕單擊?應用程序註銷後點擊後退按鈕進入應用程序頁面在播放框架
def login = Action {
{ implicit request =>
val email = request.body.asFormUrlEncoded.get("email")(0)
val password = request.body.asFormUrlEncoded.get("password")(0)
loginForm.bindFromRequest.fold(
errors => BadRequest(html.index(emailForm,errors,"Please enter valid username password")),
contact => Redirect(routes.Application.home).withSession("email" -> email,"password" -> password)
)
}
}
def home = Action { request =>
request.session.get("email").map{ user => Ok(views.html.home())
}.getOrElse{
Ok(views.html.index(emailForm,loginForm,""))
}
}
def logout = Action {
Redirect(routes.Application.index).withNewSession
}