Showing posts with label weird. Show all posts
Showing posts with label weird. Show all posts

Monday, March 26, 2012

Session variable becomes null

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"Sam" <askhuy@.yahoo.comwrote in message
news:On8wkwVRHHA.1212@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

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...
Mark Rae wrote:

Quote:

Originally Posted by

"Sam" <askhuy@.yahoo.comwrote in message
news:On8wkwVRHHA.1212@.TK2MSFTNGP03.phx.gbl...
>

Quote:

Originally Posted by

>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
"Laurent Bugnion [MVP]" <galasoft-lb@.bluewin.chwrote in message
news:utzyUrWRHHA.4896@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Quote:

Originally Posted by

>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... ;-)
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" <askhuy@.yahoo.comwrote in message
news:On8wkwVRHHA.1212@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

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
>


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:

Quote:

Originally Posted by

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" <askhuy@.yahoo.comwrote in message
news:On8wkwVRHHA.1212@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

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


>
>
>

Session variable becomes null

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"Sam" <askhuy@.yahoo.com> wrote in message
news:On8wkwVRHHA.1212@.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...
Mark Rae wrote:
> "Sam" <askhuy@.yahoo.com> wrote in message
> news:On8wkwVRHHA.1212@.TK2MSFTNGP03.phx.gbl...
>
> 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
"Laurent Bugnion [MVP]" <galasoft-lb@.bluewin.ch> wrote in message
news:utzyUrWRHHA.4896@.TK2MSFTNGP04.phx.gbl...

> Didn't take your psychic pill this morning, did you Mark?
No but, spookily, somehow I knew you were going to say that... ;-)
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" <askhuy@.yahoo.com> wrote in message
news:On8wkwVRHHA.1212@.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
>

Tuesday, March 13, 2012

Session Variables disappear

Hi NG,
I have a weird problem, that's starting to get my sanity.
My webapplication stores several values in Session["xxx"]. After a
server roundtrip, no Session variables exist anymore (Session.Count is 0)
I have logged the Session.SessionID, it is the same as before.
I have logged the last and the first line of code in my Codebehind. When
I leave the code the first time, I have a total number of 18 Session
Variables. When I enter the site again, I have 0 Session Variables.
The session timeout is 20 minutes and sessions are activates in IIS (6.0)
There is no Session.Abandon in the code.
The worst thing, I have a previous version of the webapp, which works
fine. From this version to the problematic one, I have just changed the
html-Code and added the use of the QueryString to initialize the app.
I even have uninstalled the .NET update, that hit us yesterday, cause
yesterday everything worked fine.
Not to mention, that I need to present the project next monday.
I have no ideas left anymore, if anyone could help me out, it would be
great.
Thanks in advance,
Frank"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Hi NG,
> I have a weird problem, that's starting to get my sanity.
> My webapplication stores several values in Session["xxx"]. After a server
> roundtrip, no Session variables exist anymore (Session.Count is 0)
> I have logged the Session.SessionID, it is the same as before.
>
Every time any process touches the web.config, the application is restarted,
and all the sessions are killed. Make sure no other process (like a virus
scanner) is touching your web.config.
David
Hi David

>
> Every time any process touches the web.config, the application is restarte
d,
> and all the sessions are killed. Make sure no other process (like a virus
> scanner) is touching your web.config.
thanks for your reply. I have disabled the virus scanner, but the
problem persists.
I have checked the properties of the Web.config imediate after testing
the webapp and last access was 15 minutes before.
I use my Web.config to store some appSettings, but I only read them.
Thanks anyway,
Frank
How often is IIS recycling your app?
MattC
"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
> Hi David
>
> thanks for your reply. I have disabled the virus scanner, but the problem
> persists.
> I have checked the properties of the Web.config imediate after testing the
> webapp and last access was 15 minutes before.
> I use my Web.config to store some appSettings, but I only read them.
> Thanks anyway,
> Frank
David,
re:
> Every time any process touches the web.config, the application is
> restarted, Make sure no other process (like a virus scanner) is touching
> your web.config.
A virus scanner does *not* "touch" a web.config
file in such a way as to change its file date,
which is the trigger for restarting applications.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23p3EA4EEFHA.2572@.tk2msftngp13.phx.gbl...
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Every time any process touches the web.config, the application is
> restarted, and all the sessions are killed. Make sure no other process
> (like a virus scanner) is touching your web.config.
> David
Hi MattC,

> How often is IIS recycling your app?
I have checked the properties of the application pool in which my webapp
is running. Reuse is: workerprocess reuse in 1740 minutes.
I don't know, if I translate it correctly, cause I have a german version
of IIS.
Thanks,
Frank
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> David,
> re:
> A virus scanner does *not* "touch" a web.config
> file in such a way as to change its file date,
> which is the trigger for restarting applications.
>
Some do. In particular some virus scanners use NTFS alternate file streams
to store information about the scan status of files. Writing data to an
alternate file stream generates the same file change notification as writing
to the primary stream. This causes ASP.NET to shut down the application.
David
heh, heh...
Please identify them...so I know
which virus scanners *not* to buy.
That's wicked behavior.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:eI1eTdFEFHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> Some do. In particular some virus scanners use NTFS alternate file
> streams to store information about the scan status of files. Writing data
> to an alternate file stream generates the same file change notification as
> writing to the primary stream. This causes ASP.NET to shut down the
> application.
> David

Session Variables disappear

Hi NG,

I have a weird problem, that's starting to get my sanity.

My webapplication stores several values in Session["xxx"]. After a
server roundtrip, no Session variables exist anymore (Session.Count is 0)

I have logged the Session.SessionID, it is the same as before.

I have logged the last and the first line of code in my Codebehind. When
I leave the code the first time, I have a total number of 18 Session
Variables. When I enter the site again, I have 0 Session Variables.

The session timeout is 20 minutes and sessions are activates in IIS (6.0)

There is no Session.Abandon in the code.

The worst thing, I have a previous version of the webapp, which works
fine. From this version to the problematic one, I have just changed the
html-Code and added the use of the QueryString to initialize the app.

I even have uninstalled the .NET update, that hit us yesterday, cause
yesterday everything worked fine.

Not to mention, that I need to present the project next monday.

I have no ideas left anymore, if anyone could help me out, it would be
great.

Thanks in advance,
Frank"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Hi NG,
> I have a weird problem, that's starting to get my sanity.
> My webapplication stores several values in Session["xxx"]. After a server
> roundtrip, no Session variables exist anymore (Session.Count is 0)
> I have logged the Session.SessionID, it is the same as before.

Every time any process touches the web.config, the application is restarted,
and all the sessions are killed. Make sure no other process (like a virus
scanner) is touching your web.config.

David
Hi David

>>
>>I have a weird problem, that's starting to get my sanity.
>>
>>My webapplication stores several values in Session["xxx"]. After a server
>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>
>>I have logged the Session.SessionID, it is the same as before.
>>
>
> Every time any process touches the web.config, the application is restarted,
> and all the sessions are killed. Make sure no other process (like a virus
> scanner) is touching your web.config.

thanks for your reply. I have disabled the virus scanner, but the
problem persists.
I have checked the properties of the Web.config imediate after testing
the webapp and last access was 15 minutes before.
I use my Web.config to store some appSettings, but I only read them.

Thanks anyway,
Frank
How often is IIS recycling your app?

MattC

"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
> Hi David
>>>
>>>I have a weird problem, that's starting to get my sanity.
>>>
>>>My webapplication stores several values in Session["xxx"]. After a server
>>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>>
>>>I have logged the Session.SessionID, it is the same as before.
>>>
>>
>>
>> Every time any process touches the web.config, the application is
>> restarted, and all the sessions are killed. Make sure no other process
>> (like a virus scanner) is touching your web.config.
> thanks for your reply. I have disabled the virus scanner, but the problem
> persists.
> I have checked the properties of the Web.config imediate after testing the
> webapp and last access was 15 minutes before.
> I use my Web.config to store some appSettings, but I only read them.
> Thanks anyway,
> Frank
David,

re:
> Every time any process touches the web.config, the application is
> restarted, Make sure no other process (like a virus scanner) is touching
> your web.config.

A virus scanner does *not* "touch" a web.config
file in such a way as to change its file date,
which is the trigger for restarting applications.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================

"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23p3EA4EEFHA.2572@.tk2msftngp13.phx.gbl...
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
>> Hi NG,
>>
>> I have a weird problem, that's starting to get my sanity.
>>
>> My webapplication stores several values in Session["xxx"]. After a server
>> roundtrip, no Session variables exist anymore (Session.Count is 0)
>>
>> I have logged the Session.SessionID, it is the same as before.
>
> Every time any process touches the web.config, the application is
> restarted, and all the sessions are killed. Make sure no other process
> (like a virus scanner) is touching your web.config.
> David
Hi MattC,

> How often is IIS recycling your app?

I have checked the properties of the application pool in which my webapp
is running. Reuse is: workerprocess reuse in 1740 minutes.

I don't know, if I translate it correctly, cause I have a german version
of IIS.

Thanks,
Frank

> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
>>Hi David
>>
>>
>>>>I have a weird problem, that's starting to get my sanity.
>>>>
>>>>My webapplication stores several values in Session["xxx"]. After a server
>>>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>>>
>>>>I have logged the Session.SessionID, it is the same as before.
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> David,
> re:
>> Every time any process touches the web.config, the application is
>> restarted, Make sure no other process (like a virus scanner) is touching
>> your web.config.
> A virus scanner does *not* "touch" a web.config
> file in such a way as to change its file date,
> which is the trigger for restarting applications.

Some do. In particular some virus scanners use NTFS alternate file streams
to store information about the scan status of files. Writing data to an
alternate file stream generates the same file change notification as writing
to the primary stream. This causes ASP.NET to shut down the application.

David
heh, heh...

Please identify them...so I know
which virus scanners *not* to buy.

That's wicked behavior.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================

"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:eI1eTdFEFHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
>> David,
>>
>> re:
>>> Every time any process touches the web.config, the application is
>>> restarted, Make sure no other process (like a virus scanner) is touching
>>> your web.config.
>>
>> A virus scanner does *not* "touch" a web.config
>> file in such a way as to change its file date,
>> which is the trigger for restarting applications.
>>
>>
> Some do. In particular some virus scanners use NTFS alternate file
> streams to store information about the scan status of files. Writing data
> to an alternate file stream generates the same file change notification as
> writing to the primary stream. This causes ASP.NET to shut down the
> application.
> David