1
私は奇妙な問題があり、修正できません。ブラウザでSpringアプリケーションのログアウトを避ける
問題:
私はブラウザを終了してから再度開くたび、長いセッションタイムアウトを持っている私の春のWebアプリケーションにログインするには、私のWebアプリにアクセスして、私は、ログインページのすべての時間を参照してください。
ブラウザが閉じていない限り正常に動作します。私はクロムの設定にいくつかの問題があると思ったが、そうではない。また、すべてのブラウザで発生します。
マイ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
やSpringセキュリティに問題はありませんか?
javax.http.servlet.cookieクラス最高年齢の属性を確認し、デフォルト値は-1、ブラウザがシャットダウンされた場合にクッキーを削除しています。 – notionquest
@notionquestええ問題を解決しました – Shadow
答えを追加しました。それが有用だった場合は受け入れてください。ありがとう! – notionquest