I have trying to add a remember me function in my web application. This is the configurations I made with Spring.
..........
.rememberMe().rememberMeParameter("remember-me").tokenRepository(tokenRepository)
.tokenValiditySeconds(86400).and().csrf().and().exceptionHandling().accessDeniedPage("/access_denied");
............
@Bean
public PersistentTokenBasedRememberMeServices getPersistentTokenBasedRememberMeServices() {
PersistentTokenBasedRememberMeServices tokenBasedservice = new PersistentTokenBasedRememberMeServices(
"remember-me", userDetailsService, tokenRepository);
return tokenBasedservice;
}
Once I logged into the application and checked for the cookies I see remember-me cookie as below which is to be expired tomorrow.
But once I closed the browser and opened again I'm logged out of the application and when checking for the cookie , remember-me cookie is not shown as well.
So I want to know
edit: This is the browser settings for cookies
Firefox configuration:
You have to turn off Keep local data only until you quit your browser to keep your cookies, see Google Chrome Help:
Delete cookies after you close Chrome
You can let sites remember information during your browsing session, but automatically delete the cookies when you quit Chrome.
- On your computer, open Google Chrome.
- At the top right, click More More and then Settings.
- At the bottom, click Advanced.
- Under "Privacy and security," click Content settings.
- Click Cookies.
- Turn on Keep local data only until you quit your browser.