spring-projects / spring-projects/spring-session
Add SessionContextHolder
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Add the Session to a SessionContextHolder similar to SecurityContextHolder. The SessionContextHolder would store the Session in a ThreadLocal. This will allow users to access the current Session anywhere within their stack. For example:
Session session = SessionContextHolder.getSession();
We would also want to have the SessionRepositoryFilter populate and clear out the SessionContextHolder (similar to SecurityContextPersistenceFilter).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SessionRepositoryFilter and SecurityContextPersistenceFilter to compare how request-scoped context is populated and cleared. Then inspect how SessionContextHolder and its ThreadLocal access would fit the existing Session APIs. Done means the current Session is accessible through SessionContextHolder within the stack and is cleared after request processing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100