Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms Authentication vs Session Objects problem

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hi All;

I have been having this problem for a while now and have merely been shrugging it off as not really too serious.

For the backends of my site I use forms authentication to authenticate users before they can access the admin areas. When a user's login details are confirmed I instantiate a Session object to store their user id in (for use throughout the admin areas) and I then execute the usual formsauthentication.redirect method.

The problem I seem to have (especially during development) is that the Session object often gets killed and my page throws an error stating that the Session object does not exist. Shouldn't the page redirect to the login page if these details have been lost?

Is this because the formsauthentication uses cookies rather than sessions, so the cookie is still active however the session object is dead? That's my best guess. Does anyone have a recommendation on how I might go about resolving this issue.

Thank you for any and all help.

Sean. [peace]
 
Is this because the formsauthentication uses cookies rather than sessions

No. The Forms Authentication cookie and Session variables should live together just fine.

When in the request lifecycle are you trying to access the Session object? Does this happen all the time? What is your hosting environment like?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top