Asp.net session object set to empty

I have a Session object in my asp.net application that I set to userID. The session object receives an instance in gloal.asax. The value is set to the button_click event when the user subscribes and is authenticated.

However, somewhere in my application, the session is set to Empty. How to determine where and how a session object is disconnected?

+4
source share
2 answers

Do a global search for the session variable in your project. Place a breakpoint on all lines. and then carefully navigate through the app. Two days ago I had the same error. Four hours passed, stepping over 80 pages. Good luck.

+3
source

Several reasons for this may occur:

  • Are you changing the variable to Page_Load() ?
  • Is your browser session cookie updated? (You can check with Fiddler )

In my experience, this problem will almost certainly be solved by the above.

+1
source

All Articles