Session variable becomes null

S

Sam

Hi All,

I have a very weird issue with my session variable and I'm hoping that
someone can help me out. The issue is my session variable dissappears after
a request is redirected to a new page. What I have in this new page is
streamwriter which writes user's data to a log file. Now if I comment out
the line that calls the write method of the streamwriter, the session
variable is fine.

Thanks in advance for any helps

Sam
 
G

George Ter-Saakov

Most common reasons why Session would disappear

1. Application was restarted. Happens when .NET abandons application for
whatever reason. Like leak of memory or application become irresponsive
after some time, .....

2. Config file was changed.

3. aspx files were changed (there is a limit of 15 changes aspx files, after
that application restarts).
3.1 New folder was created

4. Antivirus kicks in and starts "touching" files. Thus #4 goes to #3

5. The Session was establish under another domain name. Meaning you had
login page on www.mysite.com and the redirect user to mysite.com (no www) ->
Session is lost. Same for IP address. You established seesion on 10.10.10.10
and redirect to www.mysite.com - > Session is lost even if www.mystite.com
resolves to 10.10.10.10


Not sure what is your reason but most likely #3 or #5


George.
 
G

Guest

I am running into a similar problem in that my application at times, has a
new Session after a redirection, in the same virtual directory. I am not
calling Session.Abandon() or anything like that. The Session with stored
data simply disappears. It is a major problem.

HELP!!!

Thanks,
Eagle
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top