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
或春季安全?
檢查javax.http.servlet.cookie類最大年齡屬性,默認值是-1,是刪除cookie,如果瀏覽器被關閉。 – notionquest
@notionquest是的問題解決 – Shadow
添加了答案。請接受它是否有用。謝謝! – notionquest