У меня есть странная проблема и вы не можете ее исправить.Избегайте использования приложения Spring в браузере. Закрыть
Проблема:
я войти в мой Спринг веб-приложение, которое имеет тайм-аут сеанса долго, когда я выйти из браузера, а затем открыть его, получить доступ к своему веб-приложение, и я вижу страницу входа каждый раз.
Он работает нормально, пока браузер не закрыт. Я думал, что есть некоторые проблемы с настройками 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>
My Spring Security:
<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 Security?
Проверьте атрибут Ммаксимального класса javax.http.servlet.cookie, значение по умолчанию равно -1, который является удаление куки, если браузер отключен. – notionquest
@notionquest да проблема решена – Shadow
Добавлен ответ. Примите, если это было полезно. Благодаря! – notionquest