Session attributes lost after postback

  • Thread starter Thread starter harryaya
  • Start date Start date
H

harryaya

i separate my application into business layer and presentation layer.
After a user logged in, i fetched his/her user information and store
them in session object. And then the first page is loaded for the first
time, i can get the session variable from the session object.
but when i click a button on the aspx page, the page get postback and
the page_load method gets reloaded, this time, i can't get the session
variables though the session object remains the same. It's quite
weired.
It's quite critical for my application, i 'd like to know what's the
problem. Anyone giving the tips?

Thanks!
 
Two and only two issues can cause your problem. You are either clearing the
session somewhere in code, or you application pool is being recycled causing
you to lose you session information. It's not that difficult to isolate the
culprit. One involves examining your code, the other involves examining the
eventvwr for application recycle messages.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
Back
Top