spring-projects / spring-projects/spring-session
Session attribute not persisting which is setting at HttpSessionListener using Spring Session Data Redis
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 55
Description
Session attributes are missing/not able to fetch which are setting at HttpSessionListener
I want to set some attributes to session when session is created using HttpSessionListener, and I want to validate that attribute in the next level.
To Reproduce
After installing redis just install on localhost and default port, build and run the project shared on github.
Expected behavior
What ever attributes I am setting on session creation HttpSessionListener
public void sessionCreated(HttpSessionEvent httpSessionEvent){
HttpSession httpSession = httpSessionEvent.getSession();
System.out.println("inside listner class ====");
httpSession.setAttribute("testKey","testValue");
System.out.println("test value inside listner===>"+httpSession.getAttribute("testKey"));
}
here I am able to fetch the session atrribute testKey, but after this when flow goes to servlet, I am not getting the attribute
Sample
I have attached the code in this link
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.
Assessment
This issue has not been assessed yet.