Questions tagged [spring-session]

Spring Session provides a common infrastructure for managing user’s session information.

Spring Session provides a common infrastructure for managing user’s session information. This provides many Benefits including:

  • Accessing a session from any environment (i.e. web, messaging infrastructure, etc)

  • In a web environment

    • Support for clustering in a vendor neutral way

    • Pluggable strategy for determining the session id

    • Easily keep the HttpSession alive when a WebSocket is active

Resources

748 questions
3
votes
1 answer

Can Spring Session be turned off in Spring Boot 3?

In my Spring Boot 2.7.4 project, I use Spring Session with Redis by including these dependencies: org.springframework.boot spring-boot-starter-data-redis
Jon H
  • 394
  • 3
  • 17
3
votes
1 answer

How to read/write session attribute in Spring Cloud Gateway?

I'm trying to persist user in http session and verify authentication request inside Gateway by using a custom filter. I found a similar question too: SecurityConfig: @Configuration public class SecurityConfig { @Bean public…
Enfield Li
  • 1,952
  • 1
  • 8
  • 23
3
votes
1 answer

Spring Saml2 and Spring Session - SavedRequest not retrieved (cannot redirect to requested page after authentication / InResponseTo exception)

I am trying to use Spring Boot SAML2 + Spring Session to secure my web application (to be deployed on K8S). Everything is fine without spring-session-data-rest or spring-session-hazelcast. It can authenticate with Okta and redirect back to the…
3
votes
3 answers

Which are the advantages of the Spring Session compared with Servlet HttpSession?

Which are the advantages of the Spring Session compared with Servlet HttpSession? Where should I use the Spring session?
3
votes
1 answer

Spring Session (Redis) + Oauth2 + Spring Cloud Gateway fails when restarting application if session already exists

Version Spring Boot Version: 2.6.5 Spring Cloud Version: 2021.0.0 The application built has the following characteristics: It is a reactive application (Reactor + WebFlux) It is an Oauth2 Client Application that uses Grant Type = Authorization…
3
votes
1 answer

Spring session redis store for multi tenant application

We've been working on a spring boot application and the user session management is implemented using redis. Now we are converting the project to use multi tenant model. The problem is users from different tenants are stored under same…
ahamdsuhail
  • 103
  • 1
  • 9
3
votes
2 answers

Spring Data Redis vs Spring Session Data Redis

I am looking to implementing User Session in Spring Boot application using Redis. I have came across two great dependencies that aims to achieve these goals. Spring Data Redis and Spring Session Data Redis. However, I have tried looking for…
WeiTang Lau
  • 103
  • 1
  • 11
3
votes
1 answer

Spring Security deletes session form the database when user logs out

I'm implementing spring security in my project and have used mysql database to store sessions. Everything works fine but when the user logs out, its session is also deleted from the database which I do not want. I only want session to be invalidated…
3
votes
2 answers

How do I connect redis to Spring Boot?

I want to cocnect the Redis Docker Component to Spring Boot Session. The docker componenet is up and running Steins-MacBook-Air:~ steinkorsveien$ docker exec -it some-redis sh -c "redis-cli" 127.0.0.1:6379> exit To Spring Boot I have in the…
stein korsveien
  • 1,047
  • 5
  • 13
  • 35
3
votes
1 answer

How to persist OAuth2AuthorizedClient in redis-session

My project uses redis session with springboot session and spring security 5.1.10. I just migrated the old oauth2 implementation. Before, when I restarted the app I still had the access_token and refresh_token. With this implementation the user is…
3
votes
2 answers

Spring Security with Rest API with React

I am trying to implement Spring Security with Rest API and React as Front end, as this is my first Full Stack Development Project, I am clueless on how to achieve proper authentication mechanism. I have searched a lot and found article on Spring…
3
votes
2 answers

Spring Security - Public pages redirected to login with invalid session id

I came across an Issue where public urls won't work in Spring security, when you already have an SessionID which is not valid anymore. Example: I have the user-register page and gave it a permitAll access like…
Sunchezz
  • 740
  • 6
  • 21
3
votes
2 answers

Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer'

I am able to connect to Azure Cache for Redis with the following Spring Session configuration:
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
3
votes
1 answer

NoSuchMethodError when invoking RedisOperationsSessionRepository.delete

I'm using Spring Session and Spring Data Redis for session management. I haven't used Spring Boot. Used are as follows: spring-session: 1.3.5.RELEASE spring-data-redis: 2.1.4.RELEASE spring-webmvc: 5.0.4.RELEASE lettuce-core: 5.1.4.RELEASE Included…
asha vibin
  • 31
  • 3
3
votes
1 answer

Using JSON format with Spring Session JDBC

When you use spring-session-jdbc, the sessions are serialized in DB as bytes, which means you have to drop all sessions every time you upgrade Spring to a version with incompatible Session.serialVersionUUID. I wanted to store the session in JSON…
Jardo
  • 1,939
  • 2
  • 25
  • 45