My session becomes null when I redirect to another controller’s Action, what should I do?
My session becomes null when I redirect to another controller’s Action, what should I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I realized that I was clearing and destroying all sessions prior to setting the new session on login like this
When I removed these lines, everything started working like @Clayton said, so I removed these lines and replaced it with
Session.Remove('sessionvariablename'), I am still not sure what issue were the above lines causing, but my code started working.