anon
anon

Reputation:

Implementation of “remember me” in a Grails application

How do I implement a "Remember Me" function in Grails so that the user can check it and he won't have to log in again for 2 weeks?

I'm using the jSecurity plugin and want to change the cookie's lifetime beyond the browser session.

Upvotes: 5

Views: 1708

Answers (2)

Chii
Chii

Reputation: 14738

Spring security (formerly acegi security) has this built-in, if you can use that plugin.

otherwise, the other posted solutions work nicely.

Upvotes: 3

Jean Barmash
Jean Barmash

Reputation: 4788

JSecurity already supports RememberMe functionality. Take a look at the AuthorizationController, you'll find that it supports parameter "rememberMe."

To implement a two-week time-out, I'd add another cookie and modify AuthorizationController to behave accordingly. There may be that functionality in JSecurity, not sure about that - doesn't seem the controller respects it.

Upvotes: 4

Related Questions