aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-24 23:20:24 +0300
committerGravatar Vitaly Takmazov2017-10-24 23:21:37 +0300
commit7bc8fb4be4c345ef1cefa43540342d2dac65f23c (patch)
treecc99c057c7f51f0df3c7b1163e2b72e2de4bf232
parentde2cc2db73a5de42d9bfaeb92604f28abe2a328a (diff)
www: delete correct cookie after logout
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
index d19ad37d..3dc7bc76 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java
@@ -48,6 +48,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Resource
private UserService userService;
+ private final String COOKIE_NAME = "juick-remember-me";
+
@Bean("userDetailsService")
@Override
public UserDetailsService userDetailsServiceBean() throws Exception {
@@ -81,7 +83,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.invalidateHttpSession(true)
.logoutUrl("/logout")
.logoutSuccessUrl("/login?logout")
- .deleteCookies("hash", "remember-me")
+ .deleteCookies("hash", COOKIE_NAME)
.and()
.formLogin()
.loginPage("/login")
@@ -120,7 +122,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(
rememberMeKey, userDetailsService());
- services.setCookieName("juick-remember-me");
+ services.setCookieName(COOKIE_NAME);
services.setCookieDomain(webDomain);
services.setAlwaysRemember(true);
services.setTokenValiditySeconds(6 * 30 * 24 * 3600);