Himanth Kumar
Himanth Kumar

Reputation: 316

Clear session and redirect in same controller method (Play framework with scala)

I want to call a method from view, say using anchor tag.. It should clear the session and redirect to default page of my application. I tried

Ok("Bye").withNewSession
Redirect(routes.Application.default())

But of no use, it is redirecting without clearing the session.. Any help would be much appreciated. Thanks..

Upvotes: 2

Views: 2251

Answers (1)

serejja
serejja

Reputation: 23881

Use Redirect(routes.Application.default()).withNewSession

Upvotes: 5

Related Questions