Session attributes lost after postback

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!
 
A

Alvin Bruney [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top