奇怪的会话变量丢失 [英] Bizarre loss of Session variables

查看:45
本文介绍了奇怪的会话变量丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在访问我网站的极少数

浏览器上出现间歇性问题。奇怪的是:我的网站完美地为99.9%的浏览器工作

。下面描述的行为发生在
0.1%的用户身上,到目前为止我只在IE 6.0上看到它。


我的ASP.NET网站设置如下:


1.登录页面 - 收集用户名/密码并验证数据库。如果

OK,将UserID存储在Session [" UserID"]中并重定向到主页

2.主页面 - 如果Session [" UserID" ;] == null,重定向到登录页面,

否则显示页面。包括第二页的超链接。


3.第二页 - 如果Session [" UserID"] == null,重定向到登录页面,

否则显示页面。


以下是在极少数情况下发生的事情 - 用户可以在登录页面上成功验证
并重定向到主要

。但是,当点击链接从主页面转到第二页
页面时,会话丢失变量,第二页面将用户重定向到登录页面的b $ b。 br />

为了调试这个问题,我添加了Session.SessionID +":"的显示。 +

页面底部的会话[" UserID"]变量。结果如下:


登录页面... vmhgea20gz4azp550f203omh:

主页... vmhgea20gz4azp550f203omh:24665

第二页... vmhgea20gz4azp550f203omh:


这些结果表明SessionID在整个测试过程中保持不变,但是服务器在某种程度上会失去Session ["主页和第二页之间的UserID"]

。这似乎表明它是一个服务器问题,但是,它只发生在0.1%的访问者和

这些特定的访问者这是一个不断重复的行为。我有

指示那些用户删除他们的缓存文件和cookie并重启,

但它没有帮助。用户已准备好所有Windows更新。


有没有人看到这个问题或者知道它的解决方案?


谢谢!!

Michael Carr

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.SessionID + ":" +
Session["UserID"] variables at the bottom of the page. Here are the results:

Logon page... vmhgea20gz4azp550f203omh:
Main page... vmhgea20gz4azp550f203omh:24665
Second page... vmhgea20gz4azp550f203omh:

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

推荐答案

可能是因为Cookies在客户端浏览器中被关闭了。


-

HTH,

Kevin Spencer

..Net开发人员

Microsoft MVP

大的东西组成

的很多小东西。


" Michael Carr" < MC *** @ umich.edu>在留言中写道

新闻:呃************** @ TK2MSFTNGP12.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.edu> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl...
我有间歇性的问题这种情况发生在访问我网站的极少数浏览器上。奇怪的是:我的网站完全适用于99.9%的浏览器。下面描述的行为发生在0.1%的用户身上,到目前为止我只在IE 6.0上看到它。

我的ASP.NET网站设置如下:

1.登录页面 - 收集用户名/密码并验证数据库。如果确定,请将UserID存储在Session [" UserID"]中并重定向到主页面

2.主页面 - 如果Session [" UserID"] == null,则重定向到登录页面,否则显示页面。包括第二页的超链接。

3.第二页 - 如果Session [" UserID"] == null,重定向到登录页面,
否则显示页面。
<以下是在极少数情况下发生的情况 - 用户可以在登录页面上成功进行身份验证并重定向到
主页面。但是,在单击从主页面转到
第二页面的链接时,会话将丢失变量,而第二页面将用户重定向到登录页面。

调试这个问题,我添加了Session.SessionID +":"的显示。 +
页面底部的会话[" UserID]]变量。以下是
结果:
登录页面... vmhgea20gz4azp550f203omh:
主页面... vmhgea20gz4azp550f203omh:24665
第二页... vmhgea20gz4azp550f203omh:

这些结果表明SessionID在整个测试期间保持不变,但是服务器在主页和第二页之间以某种方式丢失了Session [" UserID]。
。这似乎表明它是一个服务器问题,然而,它只发生在0.1%的访问者和
这些特定的访问者,这是一个不断重复的行为。我已经指示这些用户删除他们的缓存文件和cookie以及
reboot,但它没有帮助。用户已准备好所有Windows更新。

是否有其他人看到此问题或了解其解决方案?

谢谢!!
Michael Carr
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.SessionID + ":" +
Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp550f203omh:
Main page... vmhgea20gz4azp550f203omh:24665
Second page... vmhgea20gz4azp550f203omh:

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



我可能不会接近你期望的答案但是我已经听说过
了解asp.net应用程序重启的情况本身

自动基于processConfig设置

machine.config(死锁处理什么的),还有IIS 6

在Windows 2003中有类似的一种功能,它可以重新启动应用程序,如果它占用内存或

某些东西......在这些情况下你会失去你的

会话。 ..


谢谢,

-Shan

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

-----原始信息 - ----
我有一个间歇性问题,发生在访问我网站的一小部分浏览器上。奇怪的是
这个:我的网站完全适用于99.9%的浏览器。下面描述的行为
发生在0.1%的用户身上,到目前为止我只在IE 6.0上看过它。

我的ASP.NET网站设置如下:

1。登录页面 - 收集用户名/密码并验证数据库的
。 IfOK,将UserID存储在Session [" UserID"]中并重定向到
主页面
2。主页面 - 如果Session [" UserID"] == null,则重定向到
登录页面,否则显示页面。包括第二个
页面的超链接。
3。第二页 - 如果Session [" UserID"] == null,请将
重定向到Logon页面,否则显示页面。

以下是在极少数情况下会发生的情况 -
- 用户可以在登录页面上成功进行验证,并将
重定向到MainPage。但是,点击链接从主
页面转到SecondPage,会话失去变量,第二页
将用户重定向到登录页面。

要调试这个问题,我添加了
Session.SessionID +":"的显示。 +页面底部的会话[" UserID]]变量。
以下是结果:
登录页面... vmhgea20gz4azp550f203omh:
主页面... vmhgea20gz4azp550f203omh:24665
第二页... vmhgea20gz4azp550f203omh:

这些结果表明SessionID在整个测试过程中保持
不变,但是服务器在某种程度上会丢失主页面和第二页面之间的
会话[" UserID]。这似乎是
表明这是一个服务器问题,但是,它只发生在0.1%的
访问者和特定访问者这是一个不断重复的
行为。我已经建议那些用户删除他们的缓存文件和
cookie并重新启动,但它没有帮助。用户拥有所有Windows
更新。
是否有其他人看到过此问题或了解其
解决方案?
谢谢!!
Michael Carr
-----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.SessionID + ":" +Session["UserID"] variables at the bottom of the page. Here are the results:
Logon page... vmhgea20gz4azp550f203omh:
Main page... vmhgea20gz4azp550f203omh:24665
Second page... vmhgea20gz4azp550f203omh:

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
.



Kevin,


不要认为它是饼干......因为他'' s得到常量会话ID ..即如果

cookie在客户端浏览器上被关闭,每个请求都会产生一个新的
会话(以及一个新的会话ID)


迈克尔,


会话曾经是最常见的存储数据的地方...它仍然是

表单身份验证...它从图片中删除会话..和

您根据票证有效性进行身份验证...我知道它不值得一试

它的唯一0.1%的用户,但有一个想法...(在票证中存储信息和

你将能够使用HttpContext.Current.User.Identity.Name

加上你可以application_authenticaterequest检查并加载值
$ b来自票证的$ b ..并且可以在你的代码中的任何地方访问..

不要忘记设置允许/拒绝角色/用户的位置元素

等。 。


-

问候,


HD


凯文斯宾塞 <柯*** @ takempis.com>在消息中写道

news:eO ************** @ TK2MSFTNGP09.phx.gbl ...
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.Current.User.Identity.Name
plus you can application_authenticaterequest 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**************@TK2MSFTNGP09.phx.gbl...
可能是因为Cookies正在在客户端浏览器中关闭。

-
HTH,
Kevin Spencer
.Net开发人员
Microsoft MVP
大事做成很多小事情。

Michael Carr < MC *** @ umich.edu>在消息中写道
新闻:呃************** @ TK2MSFTNGP12.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.edu> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl...
我有一个间歇性问题发生在访问我网站的浏览器数量非常少。奇怪的是:我的网站
适用于99.9%的浏览器。下面描述的行为发生在0.1%的用户身上,到目前为止我只在IE 6.0上看到它。

我的ASP.NET网站设置如下:

1.登录页面 - 收集用户名/密码并验证数据库。
如果确定,将UserID存储在Session [" UserID"]中并重定向到主页面

2.主页面 - 如果Session [" UserID"] == null,重定向到登录页面,否则显示页面。包括第二页的超链接。

3.第二页 - 如果Session [" UserID"] == null,重定向到登录页面,
否则显示页面。
<以下是在极少数情况下发生的情况 - 用户可以在登录页面上成功进行身份验证并重定向到
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


Main

页面。但是,单击链接从主页面转到
Page. However, upon clicking the link to go from the Main Page to the


第二个

页面时,会话丢失变量,第二页将用户
重定向到登录页面。

为了调试这个问题,我添加了Session.SessionID +":"的显示。
+会话[" UserID"]变量位于页面底部。以下是
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.SessionID + ":" + Session["UserID"] variables at the bottom of the page. Here are the


结果:


登录页面... vmhgea20gz4azp550f203omh:
主页面... vmhgea20gz4azp550f203omh:24665
第二页... vmhgea20gz4azp550f203omh:

这些结果表明SessionID在整个测试过程中保持不变
,但是服务器在某种程度上失去了Session [" UserID"]
主页面和第二页面。这似乎表明
是一个服务器问题,但是,它只发生在0.1%的访问者和
与这些特定的访问者这是一个不断重复的行为。我已经指示那些用户删除他们的缓存文件和cookie并

Logon page... vmhgea20gz4azp550f203omh:
Main page... vmhgea20gz4azp550f203omh:24665
Second page... vmhgea20gz4azp550f203omh:

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,


reboot,

但它没有帮助。用户已准备好所有Windows更新。

是否有其他人看到此问题或了解其解决方案?

谢谢!!
Michael Carr
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




这篇关于奇怪的会话变量丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆