Okay... I'm new to ASP.NET. Been programming classic ASP for quite some time, and finally started moving onto .NET.
Anyway, I have a User object. Upon login, using Forms authentication, I authenticate the user and my authentication method returns a User object. So I want to store this object in the session, to use throughout my app. So, I set a session variable to this object.
Viewing the pagestate and trace info, I see that this is indeed in the session. However, after I redirect the user to the main page, I cannot grab the session variable. I try to retrieve it, by casting it into a User object, but all I get is a null value. However, on this main page, in the trace info, I still see this session object.
Any ideas why I cannot retrieve it? I'm using the following code to retrieve it
Thanks in advance for any help...
Anyway, I have a User object. Upon login, using Forms authentication, I authenticate the user and my authentication method returns a User object. So I want to store this object in the session, to use throughout my app. So, I set a session variable to this object.
Viewing the pagestate and trace info, I see that this is indeed in the session. However, after I redirect the user to the main page, I cannot grab the session variable. I try to retrieve it, by casting it into a User object, but all I get is a null value. However, on this main page, in the trace info, I still see this session object.
Any ideas why I cannot retrieve it? I'm using the following code to retrieve it
Code:
IUser objUser = (IUser) Session["objUser"];
Thanks in advance for any help...