Last post Apr 13, 2012 04:43 PM by Rion Williams
Apr 13, 2012 04:05 PM|seiko88|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 04:13 PM|Rion Williams|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 04:28 PM|seiko88|LINK
I tryed many times this, but i seems only copy-paste from you worked :) Thank you very much!
Apr 13, 2012 04:43 PM|Rion Williams|LINK
I'm glad it helped fixed your issue :)