In the Spring security they provide 2 ways to use the rememberMe service.
Its working for me..
- In the rememberMeService Definition[Configuration file], "alwaysRememberMe" property should be true. First time when user tries to access the secure URL it will take user to login page. After first login, Application will not ask user to login again until user hits logout link or cookies has been deleted or expired.
- Other way we can provide check box on login screen to give freedom to user to choose, does he/she wants to save login or not.To make it work check box should be specified with name "_spring_security_remember_me" and value="true".Remember me service would not save user's credentials until user hits the checkbox.
Its working for me..