We are using SocialAuth
for authentication with Spring 3
and having issue with sessions between redirects.
When we do return "redirect:myURL";
in controller (after authentication) redirection happening properly but, very frequently redirect creating new session
instance instead of using my current session
which results in NullPointerException
when I look for certain variables I have stored in session
.
I have added few System.out
statements to prove that new session
is being created.
Session id is before authentication...E7557680F892C6776F36691E9DF93CF5
session ID after authentication and redirct.... 726C2EE5C240BDE4D217CBFDB9C47A0F
How can I store current session
in Spring application context before redirect and use it after redirect based on session ID? Is there any other way we can work around this in Spring?