Implementation of “remember me” in a Grails application

1.7k views Asked by At

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.

2

There are 2 answers

0
Chii On BEST ANSWER

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

otherwise, the other posted solutions work nicely.

0
Jean Barmash On

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.