473,727 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bizarre loss of Session variables

I have an intermittent problem that occurs on a very small number of
browsers that access my website. The strange thing is this: my site works
perfectly for 99.9% of browsers. The behavior described below occurs for
0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. If
OK, store the UserID in Session["UserID"] and redirect to Main Page

2. Main page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page. Includes hyperlink to Second Page.

3. Second page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page.

Here is what happens in these very small number of cases -- the user can
authenticate on the logon page successfully and gets redirected to the Main
Page. However, upon clicking the link to go from the Main Page to the Second
Page, the Session loses the variable and Second Page redirects the user to
the Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" +
Session["UserID"] variables at the bottom of the page. Here are the results:

Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughout
the test, but that the Server is somehow losing the Session["UserID"]
between the Main Page and Second Page. This would seem to indicate that it
is a server issue, however, it only happens for 0.1% of visitors and with
those particular visitors it is a constant repeatable behavior. I have
instructed those users to delete their cached files and cookies and reboot,
but it didn't help. The users have all the Windows Updates in place.

Has anybody else seen this problem or know of its solution?

Thanks!!
Michael Carr
Nov 18 '05 #1
14 2083
Possibly due to Cookies being turned off in the client browser.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Michael Carr" <mc***@umich.ed u> wrote in message
news:er******** ******@TK2MSFTN GP12.phx.gbl...
I have an intermittent problem that occurs on a very small number of
browsers that access my website. The strange thing is this: my site works
perfectly for 99.9% of browsers. The behavior described below occurs for
0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. If
OK, store the UserID in Session["UserID"] and redirect to Main Page

2. Main page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page. Includes hyperlink to Second Page.

3. Second page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page.

Here is what happens in these very small number of cases -- the user can
authenticate on the logon page successfully and gets redirected to the Main Page. However, upon clicking the link to go from the Main Page to the Second Page, the Session loses the variable and Second Page redirects the user to
the Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" +
Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughout
the test, but that the Server is somehow losing the Session["UserID"]
between the Main Page and Second Page. This would seem to indicate that it
is a server issue, however, it only happens for 0.1% of visitors and with
those particular visitors it is a constant repeatable behavior. I have
instructed those users to delete their cached files and cookies and reboot, but it didn't help. The users have all the Windows Updates in place.

Has anybody else seen this problem or know of its solution?

Thanks!!
Michael Carr

Nov 18 '05 #2
I might not be close to the answer you expect but I have
heard of cases where asp.net applications restarts itself
automatically based on processConfig settings in
machine.config( deadlock handling or something), ALSO IIS 6
in Windows 2003 has a similar kind of functionality where
it can restart applications if its taking memory or
something...in these scenarios you will loose your
sessions...

Thanks,
-Shan

-----Original Message-----
I have an intermittent problem that occurs on a very small number ofbrowsers that access my website. The strange thing is this: my site worksperfectly for 99.9% of browsers. The behavior described below occurs for0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. IfOK, store the UserID in Session["UserID"] and redirect to Main Page
2. Main page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page. Includes hyperlink to Second Page.
3. Second page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page.

Here is what happens in these very small number of cases - - the user canauthenticate on the logon page successfully and gets redirected to the MainPage. However, upon clicking the link to go from the Main Page to the SecondPage, the Session loses the variable and Second Page redirects the user tothe Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" +Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughoutthe test, but that the Server is somehow losing the Session["UserID"]between the Main Page and Second Page. This would seem to indicate that itis a server issue, however, it only happens for 0.1% of visitors and withthose particular visitors it is a constant repeatable behavior. I haveinstructed those users to delete their cached files and cookies and reboot,but it didn't help. The users have all the Windows Updates in place.
Has anybody else seen this problem or know of its solution?
Thanks!!
Michael Carr
.

Nov 18 '05 #3
Kevin,

Dont think its the cookies.. cause he's got constant session id.. ie if
cookies are turned off on client browser every request would result a new
session (and a new session id)

Michael,

session used to be the most common place to store data... its still is but
with say forms authentication. .. it removes session from the picture.. and
you authenticate based on a ticket validity... i know its not worth a try
its its only 0.1% users but have a think... (store information in ticket and
you will be able to use HttpContext.Cur rent.User.Ident ity.Name
plus you can application_aut henticatereques t to check and load the values
from the ticket.. and can access it anywhere in your code..
not to forget setting up location elements with allow / deny roles / users
etc...

--
Regards,

HD

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:eO******** ******@TK2MSFTN GP09.phx.gbl...
Possibly due to Cookies being turned off in the client browser.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Michael Carr" <mc***@umich.ed u> wrote in message
news:er******** ******@TK2MSFTN GP12.phx.gbl...
I have an intermittent problem that occurs on a very small number of
browsers that access my website. The strange thing is this: my site works perfectly for 99.9% of browsers. The behavior described below occurs for
0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. If OK, store the UserID in Session["UserID"] and redirect to Main Page

2. Main page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page. Includes hyperlink to Second Page.

3. Second page - If Session["UserID"] == null, redirect to Logon page,
otherwise display the page.

Here is what happens in these very small number of cases -- the user can
authenticate on the logon page successfully and gets redirected to the

Main
Page. However, upon clicking the link to go from the Main Page to the

Second
Page, the Session loses the variable and Second Page redirects the user to the Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" + Session["UserID"] variables at the bottom of the page. Here are the

results:

Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughout the test, but that the Server is somehow losing the Session["UserID"]
between the Main Page and Second Page. This would seem to indicate that it is a server issue, however, it only happens for 0.1% of visitors and with those particular visitors it is a constant repeatable behavior. I have
instructed those users to delete their cached files and cookies and

reboot,
but it didn't help. The users have all the Windows Updates in place.

Has anybody else seen this problem or know of its solution?

Thanks!!
Michael Carr


Nov 18 '05 #4
Shan,

the worker process is restarted if the total memory consumed by it exceeds
60% of physical memory.
or depending upon the parameters set in the machine.config file

but if the application where to restart then the session id would be
diffent....

--
Regards,

HD

"Shan" <an*******@disc ussions.microso ft.com> wrote in message
news:03******** *************** *****@phx.gbl.. .
I might not be close to the answer you expect but I have
heard of cases where asp.net applications restarts itself
automatically based on processConfig settings in
machine.config( deadlock handling or something), ALSO IIS 6
in Windows 2003 has a similar kind of functionality where
it can restart applications if its taking memory or
something...in these scenarios you will loose your
sessions...

Thanks,
-Shan

-----Original Message-----
I have an intermittent problem that occurs on a very

small number of
browsers that access my website. The strange thing is

this: my site works
perfectly for 99.9% of browsers. The behavior described

below occurs for
0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify

against the DB. If
OK, store the UserID in Session["UserID"] and redirect to

Main Page

2. Main page - If Session["UserID"] == null, redirect to

Logon page,
otherwise display the page. Includes hyperlink to Second

Page.

3. Second page - If Session["UserID"] == null, redirect

to Logon page,
otherwise display the page.

Here is what happens in these very small number of cases -

- the user can
authenticate on the logon page successfully and gets

redirected to the Main
Page. However, upon clicking the link to go from the Main

Page to the Second
Page, the Session loses the variable and Second Page

redirects the user to
the Logon page.

To debug this problem, I added a display of the

Session.Session ID + ":" +
Session["UserID"] variables at the bottom of the page.

Here are the results:

Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining

constant throughout
the test, but that the Server is somehow losing the

Session["UserID"]
between the Main Page and Second Page. This would seem to

indicate that it
is a server issue, however, it only happens for 0.1% of

visitors and with
those particular visitors it is a constant repeatable

behavior. I have
instructed those users to delete their cached files and

cookies and reboot,
but it didn't help. The users have all the Windows

Updates in place.

Has anybody else seen this problem or know of its

solution?

Thanks!!
Michael Carr
.

Nov 18 '05 #5
From my understanding about Cookies and Session State, the SessionID is
actually the cookie that is sent from the client to the server for each
request and session variables themselves are actually kept on the server.
So, since my debug routines show the same SessionID for every request, this
would indicate that the browser is indeed sending the correct cookie... am I
correct in my thinking here?

Michael Carr

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:eO******** ******@TK2MSFTN GP09.phx.gbl...
Possibly due to Cookies being turned off in the client browser.

Nov 18 '05 #6
This is how I got around this.

I changed the location of the session variables to
stateserver and just used the loopback address for the web
server and fired up the stateserver on the web server and
have not had any problems since.

-----Original Message-----
I have an intermittent problem that occurs on a very small number ofbrowsers that access my website. The strange thing is this: my site worksperfectly for 99.9% of browsers. The behavior described below occurs for0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. IfOK, store the UserID in Session["UserID"] and redirect to Main Page
2. Main page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page. Includes hyperlink to Second Page.
3. Second page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page.

Here is what happens in these very small number of cases - - the user canauthenticate on the logon page successfully and gets redirected to the MainPage. However, upon clicking the link to go from the Main Page to the SecondPage, the Session loses the variable and Second Page redirects the user tothe Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" +Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughoutthe test, but that the Server is somehow losing the Session["UserID"]between the Main Page and Second Page. This would seem to indicate that itis a server issue, however, it only happens for 0.1% of visitors and withthose particular visitors it is a constant repeatable behavior. I haveinstructed those users to delete their cached files and cookies and reboot,but it didn't help. The users have all the Windows Updates in place.
Has anybody else seen this problem or know of its solution?
Thanks!!
Michael Carr
.

Nov 18 '05 #7
Probably, but it might be worth checking out.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Michael Carr" <mc***@umich.ed u> wrote in message
news:OL******** ******@TK2MSFTN GP09.phx.gbl...
From my understanding about Cookies and Session State, the SessionID is
actually the cookie that is sent from the client to the server for each
request and session variables themselves are actually kept on the server.
So, since my debug routines show the same SessionID for every request, this would indicate that the browser is indeed sending the correct cookie... am I correct in my thinking here?

Michael Carr

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:eO******** ******@TK2MSFTN GP09.phx.gbl...
Possibly due to Cookies being turned off in the client browser.


Nov 18 '05 #8
Here is my web.config for the state server solution I
provided.

<sessionState
mode="StateServ er"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data
source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>

-----Original Message-----
This is how I got around this.

I changed the location of the session variables to
stateserver and just used the loopback address for the webserver and fired up the stateserver on the web server and
have not had any problems since.

-----Original Message-----
I have an intermittent problem that occurs on a verysmall number of
browsers that access my website. The strange thing is

this: my site works
perfectly for 99.9% of browsers. The behavior described

below occurs for
0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify

against the DB. If
OK, store the UserID in Session["UserID"] and redirect

toMain Page

2. Main page - If Session["UserID"] == null, redirect toLogon page,
otherwise display the page. Includes hyperlink to Second

Page.

3. Second page - If Session["UserID"] == null, redirect

to Logon page,
otherwise display the page.

Here is what happens in these very small number of

cases -- the user can
authenticat e on the logon page successfully and getsredirected to the Main
Page. However, upon clicking the link to go from the

MainPage to the Second
Page, the Session loses the variable and Second Pageredirects the user to
the Logon page.

To debug this problem, I added a display of the

Session.Sessio nID + ":" +
Session["UserID"] variables at the bottom of the page.

Here are the results:

Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining

constant throughout
the test, but that the Server is somehow losing the

Session["UserID"]
between the Main Page and Second Page. This would seem

toindicate that it
is a server issue, however, it only happens for 0.1% of

visitors and with
those particular visitors it is a constant repeatable

behavior. I have
instructed those users to delete their cached files and

cookies and reboot,
but it didn't help. The users have all the Windows

Updates in place.

Has anybody else seen this problem or know of its

solution?

Thanks!!
Michael Carr
.

.

Nov 18 '05 #9
JN
The exact same thing happens to me on this particular
machine.
I have 3 development machines, on 2 of them (one is
Win2000 and the other is XP), the session variables work
fine.
On this machine I'm using, the session variables are lost
in between. The problematic machine is almost a brand new
one, runs on Win2000, with the same memory space as that
of the one that works.
And I don't use cookies (I set cookiesless=tru e).

I'm interested to see how to solve this.
-----Original Message-----
I have an intermittent problem that occurs on a very small number ofbrowsers that access my website. The strange thing is this: my site worksperfectly for 99.9% of browsers. The behavior described below occurs for0.1% of users, and so far I've only seen it on IE 6.0.

My ASP.NET website is set up like this:

1. Logon page - Collect username / password and verify against the DB. IfOK, store the UserID in Session["UserID"] and redirect to Main Page
2. Main page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page. Includes hyperlink to Second Page.
3. Second page - If Session["UserID"] == null, redirect to Logon page,otherwise display the page.

Here is what happens in these very small number of cases - - the user canauthenticate on the logon page successfully and gets redirected to the MainPage. However, upon clicking the link to go from the Main Page to the SecondPage, the Session loses the variable and Second Page redirects the user tothe Logon page.

To debug this problem, I added a display of the Session.Session ID + ":" +Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp5 50f203omh:
Main page... vmhgea20gz4azp5 50f203omh:24665
Second page... vmhgea20gz4azp5 50f203omh:

These results indicate that the SessionID is remaining constant throughoutthe test, but that the Server is somehow losing the Session["UserID"]between the Main Page and Second Page. This would seem to indicate that itis a server issue, however, it only happens for 0.1% of visitors and withthose particular visitors it is a constant repeatable behavior. I haveinstructed those users to delete their cached files and cookies and reboot,but it didn't help. The users have all the Windows Updates in place.
Has anybody else seen this problem or know of its solution?
Thanks!!
Michael Carr
.

Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2849
by: Microsoft | last post by:
I am using Session variables in my ASP application. I have tested the application on a Win2k professional and it works fine. When the same web app is installed on a win2k advanced server from the client browser when the app is accessed the session variable returns null inspite of a value being already set. I have checked the IIS enable session state settings. When i use the server machine as client and access the app as localhost then...
0
453
by: mbosco51 | last post by:
I know this is a common thread, but I seem to be losing session variables on my website. I read through everything I could find, including this link: http://aspfaq.com/show.asp?id=2157, but cannot seem to fix the problem. First so history... we were getting a lot of reports of session loss on a particular page. Eventually we tracked it down to the fact that we were launching pop up windows, which do not always share the same state. ...
1
3186
by: Steve Remer | last post by:
My application (relevant code snippets below) originally used Session variables in order to maintain state from page to page. After being unable to solve the mystery of why those variables were intermittently inaccessible, (all Session variables gone, not using InProc Session state mode), I moved to a cookies-based solution. Now I have cookie contents that are intermittently inaccessible. Someone suggested using session variables to...
4
5590
by: PJ | last post by:
A particular page seems to be having issues with correctly setting Session variables. I am setting a couple of session variables on the Page_Unload event. While stepping through code, the immediate window will show the values in Session after the relevant lines that set the variables in the Page_Unload event. However, on postback, these variables are no longer in Session. All Session variables that were set previous to that particular...
2
2600
by: competitions | last post by:
I notice that others have had this problem, after scanning Google, but I couldn't find any solution. I have tested my PHP code on both Mac's & PC's and on several browsers (Firefox, Safari, IE etc etc), with several operating systems. Everything works fine, except ... On a couple of Windows XP SP2 PC's session variables in IE6 seem from time to time to get 'lost'.
5
3184
by: Ed | last post by:
I have some questions in regards to Session variables and IIS Recycling: 1. Does the IIS setting 'Shutdown worker process after being idle' affect an application's session variables? Or is IIS checking that all sessions are done before shutting down the worker processes? 2. Does the Recycle worker processes setting kill all session variables of
4
2839
by: leena13 | last post by:
Hi, I am facing a problem of loss of session variables once the ASP.Net 2.0 application is deployed. Let me add that this is actually a 1.1 to 2.0 migration. I found that the first time the page is posted, I found that session variables are getting lost. When I hit Back on IE, and re-enter, the session variables exist and things move smoothly. This problem was not occurring when I tested on my machine, but only after deployment to the...
8
2115
by: schlaag | last post by:
I have an asp based site which for various reasons has to go in either Trusted Sites or Intranet under security in IE7. However as soon as I place it in either of these zoneI can no longer use session variables. These session variables work fine when it is in the Internet zone. Any ideas anyone?
6
2047
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a web application vs2005 and it looks like a condition is causing session veriables to be lost. This does not seem to be happening too often. The web application allows uploading and deleting files on the server, but not in the bin directory. I am not sure if this is related. Any idea what might be causing this and how to fix it? Thanks. -- Paul G Software engineer.
0
8890
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8101
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.