Servlet cookies session is not consistent between environment, Lets say i have two testing region with same code and setting, but it working fine with one environment and not with other environment.
Added this to setup Redis caching.
server: servlet: session: cookie: domain: company.com name: X-Session-Reference http-only: true secure: true
Scenario:
First hit works fine, following that it keep failing. Same after some delay.
It seems like two calls are having some race condition and session gets invalidated before second call reaches with same session id.
"message":"Unknown exception occurred while processing the request","context":"default","exception":"java.lang.IllegalStateException: Session was invalidated\n\tat org.springframework.session.data.redis.RedisSessionRepository.save(RedisSessionRepository.java:129)\n\tat org.springframework.session.data.redis.RedisSessionRepository.save(RedisSessionRepository.java:45)\n\tat org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryRequestWrapper.commitSession(SessionRepositoryFilter.java:229)\n\tat org.springframework.session.web.http.SessionRepositoryFilter$SessionRepositoryResponseWrapper.onResponseCommitted(SessionRepositoryFilter.java:180)\n\tat org.springframework.session.web.http.OnCommittedResponseWrapper.doOnResponseCommitted(OnCommittedResponseWrapper.java:227)\n\tat