2016-11-07 53 views
1

我有一个奇怪的问题,无法修复它。避免弹出应用程序注销浏览器关闭

问题:

我登录到具有较长的会话超时,每当我退出浏览器,然后重新打开我的春节,Web应用程序,访问我的web应用程序,我看到每一次的登录页面。

只要浏览器没有关闭,它就可以正常工作。我认为chrome设置存在一些问题,但事实并非如此。它也发生在所有的浏览器上。

web.xml

<session-config> 
     <session-timeout>10000</session-timeout> 
     <cookie-config> 
      <name>myapp</name> 
      <http-only>true</http-only> 
     </cookie-config> 
     <tracking-mode>COOKIE</tracking-mode> 
    </session-config> 

我的春天安全配置:

<security:http auto-config="true" use-expressions="true"> 
     <security:intercept-url pattern="/resources/**" access="permitAll" /> 
     <security:intercept-url pattern="/login" access="permitAll" /> 
     <security:intercept-url pattern="/login/forgot" access="permitAll" /> 
     <security:intercept-url pattern="/login/resetpassword" access="permitAll" /> 
     <security:intercept-url pattern="/home/admin/**" access="hasAnyRole('ROLE_admin', 'ROLE_manager')" /> 
     <security:intercept-url pattern="/**" access="hasAnyRole('ROLE_admin', 'ROLE_manager','ROLE_user')" /> 
     <security:form-login 
      login-page="/login" 
      login-processing-url="/login" 
      authentication-failure-handler-ref="authenticationFailureFilter" 
      authentication-success-handler-ref="authenticationSuccessHandler" 
      username-parameter="email" 
      password-parameter="password" /> 
     <!-- enable csrf protection --> 
     <security:csrf/> 

    </security:http> 

有任何问题,我web.xml或春季安全?

+1

检查javax.http.servlet.cookie类最大年龄属性,默认值是-1,是删除cookie,如果浏览器被关闭。 – notionquest

+0

@notionquest是的问题解决 – Shadow

+0

添加了答案。请接受它是否有用。谢谢! – notionquest

回答

相关问题