Session state does not persist between pages

I am having problems with the asp.net C # site where I set the session state object to true and then redirected to another page that should check the value of the session state object and it is null.

Sometimes it installs correctly, and other times is just null.

When I debug my local machine, it works great every time. Only when I upload to my web server does this temperamental behavior occur.

Since it is based on site security, it is obviously important that the session data is valid and accurate every time.

Is the session state data unsatisfactory?

AFAIK its set for inproc, cookieless, timeout 30 minutes, vanilla IIS installation.

Does anyone have any suggestions? Perhaps I need to execute thread.sleep between storing session data and reading?

NB: the time between writing and reading is about 70 ms .. enough time to write data to RAM .....

+5
source share
4 answers

If session state is lost, it is usually because your process either processes or fails. I will never β€œrely” on session state between pages. Instead, you can try to save data between pages in some other way. Perhaps the transfer of information through variable forms or storing data in a database.

ASP.NET . , ASP.NET.

+1

. , . . ASP.NET , , -, , , ..

, . . , , , .

+2

-. - , , .

" !"

+2

, Claudio - .

, - 90-. .

FormsAuthentication , .

, .

Security is not one of them.

+2
source

All Articles