Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 13, 2012 03:43 PM by Rion Williams
Apr 13, 2012 03:05 PM|LINK
Hello. I have a 5 hours searching problem...All my login data inside session is lost. In SignIn i have:
Session["customer"] = customer;
The customer is added in session but after redirect, when i chck in Order if it is there, my session is null. What should i do?
In order i have i am using:
if (HttpContext.Current.Session["customer"] != null) - wich is always null
Apr 13, 2012 03:13 PM|LINK
The Session may not be migrating across the two areas - and the Redirect could be the culprit.
Bertrand Le Roy discusses this same topic in his blog and why not to use Redirects after manipulating the Session:
Bertrand Le Roy : Don't Redirect After Session Variable Changes
He presents two solutions - the first, which applies to FormsAuthentication, uses an already predefined to handle this very purpose:
The other solution is to overload the original version of the Redirect method, by passing false as the second parameter:
Apr 13, 2012 03:28 PM|LINK
I tryed many times this, but i seems only copy-paste from you worked :) Thank you very much!
Apr 13, 2012 03:43 PM|LINK
I'm glad it helped fixed your issue :)