Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forwarding request breaks session clustering #57

Open
emre-aydin opened this issue Jul 21, 2017 · 1 comment
Open

Forwarding request breaks session clustering #57

emre-aydin opened this issue Jul 21, 2017 · 1 comment

Comments

@emre-aydin
Copy link
Contributor

emre-aydin commented Jul 21, 2017

  1. Spring MVC forwards the request when you return "forward:/api/createSession" from your controller's request handler method - by using javax.servlet.RequestDispatcher#forward
  2. Tomcat's javax.servlet.RequestDispatcher implementation org.apache.catalina.core.ApplicationDispatcher wraps the request in an org.apache.catalina.core.ApplicationHttpRequest instance in its doForward method.
  3. ApplicationHttpRequest implements getSession() method and has no knowledge about the Hazelcast session. When getSession() is called on the request, it doesn't get the session from Hazelcast.

Different version of Tomcat have the same problem. We might look into how other containers behave, but ultimately we need to make sure it works on all containers.

See #47 for more history on the issue.

We have a reproducer thanks to @michael-kalpana
forward-bug-patch.zip

@HagarJNode
Copy link

HagarJNode commented Jun 3, 2019

I'm having the same problem when I use RequestContextHolder.currentRequestAttributes().getRequest().getSession() the Hazelcast session object is ignored. The ApplicationHttpRequest gives another(new?) session object. Is there any progress on this issue?

Using Hazelcast 3.10.6 btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants