Questions tagged [spring-session]
Spring Session provides a common infrastructure for managing user’s session information.
668
questions
1
vote
3
answers
73
views
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?
1
vote
0
answers
24
views
How can I keep the original URL after Spring Security authentication when using Spring Session Data MongoDB?
I have created a simple SAML 2.0 Service Provider using Spring Security that authenticates with an external Identity Provider. The authenticated session is managed externally in MongoDB using the ...
0
votes
0
answers
18
views
Spring OAuth2 authentication with custom service behind Zuul gateway
I have to make a microservices project in which user can authenticate with OAuth2.
I did adapt this guide (https://www.javachinna.com/spring-boot-angular-10-user-registration-oauth2-social-login-part-...
-1
votes
1
answer
71
views
Single shared session for multiple Spring Boot microservices in Redis
I have several separated Spring Boot microservices. Sessions are created separately for every microservice (and their instances). I have Spring Session involved, that helps with creating a single ...
1
vote
0
answers
40
views
set Domain on cookie using spring security when login success
How can I set the property "domain" on the users cookie when the user has authenticated from spring?
Edit: id like to add domain=".mydomain.com" to cookie with id JSESSIONID
I dont ...
0
votes
0
answers
21
views
why spring redis session 'touch' method called in 'cleanExpiredSessions' method can clean expired session
i am chinese,My English is so poor,I try my best to describe my problem clearly
I recently learned about the spring redis session cleaning mechanism,the clean method is 'cleanExpiredSessions' in ...
1
vote
0
answers
115
views
Cannot prevent Multiple sessions for same user in spring security + redis
I am using spring security 5.6.0 with spring session data redis 2.6.0, spring boot 2.6.1.
I am trying to prevent concurrent logins for the same user. But it does not logs out the previous login ...
0
votes
1
answer
194
views
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 ...
0
votes
0
answers
44
views
java.lang.NoClassDefFoundError: org/springframework/data/redis/core/DefaultBoundSetOperations
I am new in spring session. and want to handle http session of my simple spring MVC project with Redis. I am using following POM
<project xmlns="http://maven.apache.org/POM/4.0.0"
...
0
votes
1
answer
42
views
What does requestedSessionCached do, and under what circumstances does it become true
I've been learning on SpringSession source code, I found that in SessionRepositoryRequestWrapper class contains a Boolean value: RequestedSessionCached, which is used in the getRequestedSession method ...
0
votes
0
answers
44
views
How to use MySQL to store Spring Cloud Gateway sessions
I am trying to set up two instances of Spring Cloud Gateway to work with IdP to authenticate with the oAuth2 Authorization Code flow. The load balancer in front of the two gateway instances is round ...
0
votes
0
answers
57
views
spring-session-jdbc timeout handler
I am using Spring Session Jdbc for session management and need to do some custom operations on session Timeout listener. How should I do this? I tried to use HttpSessionListener, but this doesn't work,...
0
votes
1
answer
56
views
Spring session redis as my session storage
I am looking for an appropriate way to store the session attributes in third-party data storage like redis or mysql, how should I decide which one to pick? What scenario is fitful for using the redis?
1
vote
0
answers
172
views
Spring GW Oauth2 Client and Spring Session Redis - Loop in authentication in round robin cluster
I have a Spring Cloud Gateway service (reactive version) with Spring Security, which is Oauth2 client to a PingID service with Authorization Code Flow.
It is going to act as a BFF for a JS SPA client ...
0
votes
1
answer
315
views
Spring Session Redis Data is not clearing index to sessions in Redis
I am using Spring Session Redis Data (configured with autoconfiguration, no customizations so far) which defaults to using FindByIndexNameSessionRepository as the SessionRepository implementation.
...
0
votes
0
answers
108
views
After implementing Spring Session Management Spring security keeps forwarding me to the login page
I am working on JEE application. We recently switched from container based security to spring security. I am now trying move session handling out of the container and into the application using ...
0
votes
1
answer
126
views
Spring security - Specific session creation policy per matchers
I'm trying to implement SessionCreationPolicy.ALWAYS for the /testMVCController/** endpoint and SessionCreationPolicy.STATELESS for rest of endpoints (/**).
Expected scenario:
When accessing to /...
0
votes
1
answer
67
views
Start a session from a given id in spring
How can I create a session in a spring mvc application from a given ID instead of a generated one?
I want to fixate the session.
The fixation will be started by a trusted ui service. This trusted ...
0
votes
0
answers
45
views
Why does Spring's Hazelcast4IndexSessionRepository implement deltas and a Hazelcast EntryProcessor?
Spring-session provides a Hazelcast4IndexedSessionRepository that stores the session data (represented as MapSession) in a Hazelcast cache. Instead of returning the MapSession directly from the ...
0
votes
0
answers
135
views
How can you achieve live session migration using spring-session-data-redis?
I have an existing spring-session SessionRepository, and would like to move to spring-session-data-redis.
This is easy (and works) with minimal effort except for the following.
The application ...
0
votes
0
answers
38
views
How do you change the session ID format in RedisIndexedSessionRepository
I'm using an existing datastore for the SessionRegistry, and it is limited to using timeUUID for the sessionID.
This is encrypted/decrypted in a CookieHttpSessionIdResolver to prevent "guessing/...
0
votes
0
answers
64
views
Spring Session generates a new JSESSIONID with every request
I am using Spring Session 1.3.5.
The problem is that it is creating a new JSESSIONID for every HTTP request. I have noticed that this kicks-in before the response is committed by the filter's method ...
2
votes
1
answer
86
views
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 ...
0
votes
1
answer
98
views
Staled sessions with `null` principal name in Spring Session Redis Index
I'm storing sessions in Redis using spring-boot and spring-session-redis.
I have the following use-case.
When a user lands at /admin, Spring Boot generates an anonymous session for such user and ...
0
votes
0
answers
24
views
Spring session data consistency guarantee
I have some questions about what data consistency guarantee I can expect from spring boot session jdbc.
Suppose we have this scenario:
A stateful session in a spring boot application with spring ...
0
votes
0
answers
145
views
Redis: NoSuchMethodError: when invoking Redis opertaion Delete
Im using Spring session, Spring Data redis and redis clients for session management. Here im getting belw exception while deploy the application.
Version:
spring-session : 1.3.5.RELEASE
spring-data-...
0
votes
0
answers
77
views
Redis Session with Lettuce config and ssl
I am currently trying to connect to my Redis service (supplied by Heroku) however I am having a problem when it comes to connecting to SSL variant (rediss://).
When I run the program I get an error ...
1
vote
0
answers
65
views
How to update data in all user redis session
We use Spring session with Redis, and store in the session user ID and user Role.
When we need to change the user role, we don't want to delete all user session, as the user will need to sing in in ...
0
votes
0
answers
138
views
Vaadin login page conitiously and automatically reloads with spring-session-jdbc
I've just started to dive into Vaadin UI development, please excuse me in case of any silly mistakes. Can someone please help?
I built a simple sbring-boot application, that uses spring-security for ...
0
votes
0
answers
118
views
Spring Security, remote user becomes null after session timeout
Here is my Spring Security config
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private String sLogoutUrl_;
private String ...
0
votes
0
answers
24
views
JSF 2.2 + Spring with Viewscoped beans managed by JSF
I'm trying to implement Load Balancing using JSF + Spring sessions + Redis. For the most part it is working but I'm having problems with Viewscoped Beans because these are getting created on every ...
0
votes
0
answers
91
views
Spring boot multiple sessions in same browser window
I want to implement multiple sessions per user in same browser window in my sprig boot app
I am using spring boot 2.3.9
so far what I have came across is CookieHttpSessionStrategy using sessionalias ...
0
votes
1
answer
297
views
Spring Session Hazelcast Concurrency Control Multiple JVM on Tomcat
Product Versions:
spring-boot-starter-parent 2.6.0
com.hazelcast.hazelcast 5.0
spring-session-hazelcast 2.6.0
com.hazelcast.hazelcast-all - 4.2.2
spring-session-core 2.6.0
spring-boot-starter-security ...
0
votes
1
answer
319
views
ERROR: duplicate key value violates unique constraint "spring_session_attributes_pk"\n Detail: Key (session_primary_id, attribute_name)
Currently, I'm using:
Spring boot 2.2.2
Spring jdbc 2.5.0
Spring core 2.5.0
Sometimes, I got errors when accessing my endpoints, here is the stack trace, this happen after upgrading my library from:
...
0
votes
0
answers
41
views
Spring Session and security management for grails application Web service
I have recently started working on a Grails spring application which uses spring 4.2.5.RELEASE version. There is a requirement to provide a REST API to an external application, but the API is supposed ...
0
votes
0
answers
31
views
Can I use EnableRedisHttpSession annotation with Spring 4.0.3 version?
I am trying to implement Redis session to capture and save session in the Redis cache. I found few great solution and implementation but those all examples are using Spring 5 and over versions. What ...
0
votes
1
answer
154
views
HttpSessionStorage - Message not found in SESSION
I was able to integrate Single Sign-On using Spring Security SAML into my web app. But I'm having issues when adding this dependency org.springframework.session.
First it stores data to the session, ...
0
votes
0
answers
50
views
Hazelcast Add Local Entry Listener Only Once
I have a 3-node application that includes an embedded Hazelcast instance (so, 3 instances). These are used in the application for session sharing across the nodes. In the configuration, I added a ...
0
votes
0
answers
33
views
Does Spring Session recognize rSockets keepalive and increase the expires time?
We have a spring webflux based application with rSocket for websocket communication. The keepAlive is set to 20s and the spring.session.timeout is set to 30s and uses mongoDb as store. Spring session ...
1
vote
1
answer
1k
views
Spring Boot with Spring Session and Redis - RedisConnectionFactory is required
I am setting up a Spring Boot app that uses:
OAuth2 Login
Spring Session for authentication
Redis for the session storage
Using this spring boot application.yaml to enable redis:
spring:
session:
...
1
vote
0
answers
198
views
Session expiry management for spring boot
I have set session timeout of 3mins in my project:
My application.yml file
servlet:
contextPath: /
session:
cookie:
name: TEST_SESSION
max-age: 180
...
0
votes
1
answer
190
views
What is the replacement of EJB SessionContext object in spring boot?
I am migrating an EJB project to Spring boot project. I have successfully replaced other annotations to the spring annotation, but havving problem with SessionContext object.
My legacy code is bellow
@...
1
vote
1
answer
87
views
Spring Session Redis web session expiration notifications not delayed until application is up again?
Currently using Spring Session Redis in a Spring Boot 2.5 web application.
The application correctly receives web session expiration notifications from Redis, but AFAIK only if the application is up ...
0
votes
0
answers
275
views
Spring Security session object serialization with SecurityJackson2Modules
I'm using Spring Security with Spring Session which serializes the session to Redis as JSON. To make it properly working I make this Spring Session configuration. Also, I added SecurityJackson2Modules ...
0
votes
0
answers
184
views
spring security: authentication by session from backend another application
I created my backend on spring boot and I used standard spring session authentication. I see, that spring after success auth marks my session id as authenticated.
On the other service I have simple ...
0
votes
1
answer
129
views
WebSessions not displaying replicating behaviour with Spring Session and Keycloak
I have created an API gateway using Spring Cloud Gateway.
The Gateway is using Spring OAuth2 Client to connect to Keycloak.
Spring Session is present, configured to work with Redis (@...
0
votes
0
answers
129
views
infinispan - cluster of embedded notes with spring session
I'm trying to create a cluster of infinispan nodes, where each node is embedded in a spring boot web application. This clustered cache need to be the backend of the webapp session, through spring-...
0
votes
1
answer
118
views
Spring session table not created in Docker container
When I'm launching my Spring application from my IDE (IntelliJ), there is no problem with the creation of all the tables including the Spring Session table.
However, when I'm launching it with the ...
0
votes
1
answer
185
views
Spring Session JDBC Problem adding in my project
currently I have a project with Spring MVC which already interact with Database(MariaDB) and I would like to try the spring-session-jdbc. I found the documentation in this spring-session , I do what ...
0
votes
0
answers
157
views
Configuring variable session timeout in spring session
We have a requirement where we want to implement a variable session timeout depending on the user's preference at the time of login. The default setting for session timeout is 30 minutes.
If the user ...