By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,908 Members | 2,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,908 IT Pros & Developers. It's quick & easy.

Session variable becomes null

P: n/a
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
Jan 31 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Sam" <as****@yahoo.comwrote in message
news:On**************@TK2MSFTNGP03.phx.gbl...
I have a very weird issue with my session variable and I'm hoping that
someone can help me out.
A little difficult unless you actually post your code...
Jan 31 '07 #2

P: n/a
Mark Rae wrote:
"Sam" <as****@yahoo.comwrote in message
news:On**************@TK2MSFTNGP03.phx.gbl...
>I have a very weird issue with my session variable and I'm hoping that
someone can help me out.

A little difficult unless you actually post your code...
Didn't take your psychic pill this morning, did you Mark?

:-)

--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 31 '07 #3

P: n/a
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:ut**************@TK2MSFTNGP04.phx.gbl...
>A little difficult unless you actually post your code...

Didn't take your psychic pill this morning, did you Mark?
No but, spookily, somehow I knew you were going to say that... ;-)
Jan 31 '07 #4

P: n/a
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.
"Sam" <as****@yahoo.comwrote in message
news:On**************@TK2MSFTNGP03.phx.gbl...
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

Feb 1 '07 #5

P: n/a
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

"George Ter-Saakov" wrote:
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.
"Sam" <as****@yahoo.comwrote in message
news:On**************@TK2MSFTNGP03.phx.gbl...
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


Apr 24 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.