Session Data Lost

  • Thread starter Thread starter blue
  • Start date Start date
B

blue

Sometimes, my web apps will lose session information that was set by the
login form. My apps aren't changing Session["UserID"] but are checking to
see if Session["UserID"] is null when the page is loaded. If it is null, it
redirects them to the login page. I'm in an infinite loop -- I log in,
click on the link for my app and then get redirected back to log in again.

This only happens sometimes and with a few aspx pages.

My SessionID number is the same the whole time.

This is my page directive:
Page language="c#" Codebehind="ProcessDisplay.aspx.cs" trace=true
AutoEventWireup="false"
Inherits="IBS.Tabs.Process.Presentation.ProcessDisplay"
 
Sometimes, my web apps will lose session information that was set by the
login form. My apps aren't changing Session["UserID"] but are checking to
see if Session["UserID"] is null when the page is loaded.

You should use FormsAuhentication, it does what you want without the need
for every page to check the session variable.
I'm in an infinite loop -- I log in, click on the link for my app
and then get redirected back to log in again.

It seems like your session doesn't last for very long (like longer than 1
request). You can check that by putting test code in Session_Start and
Session_End, logging to a file.
This only happens sometimes and with a few aspx pages.
My SessionID number is the same the whole time.

This gets recycled as long as you keep requesting from the same browser.
Inherits="IBS.Tabs.Process.Presentation.ProcessDisplay"

Sure this is a System.Web.UI.Page descendant?
 
Back
Top