会话和应用程序变量消失了 [英] Session and Application Variables dissappearing

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

问题描述

我之前提到的会话和应用程序有一个问题

变量在一个站点消失但在其他站点消失或在我的开发中消失​​

计算机。


问题在一个例子中说明了
http://www.lamartin.com/dotnet/sessiontestset.aspx ,我设置了Session,

应用程序和缓存变量在第一页然后在第二页

页面查看它们,因为第二页每五秒刷新一次。在

10刷新之前,变量已经消失。奇怪的是,至少对我来说,仍然可以检索到会话ID的
。那么,在什么情况下你是否b $ b保留会话ID但丢失会话变量?


页面托管在共享环境中的Windows 2003服务器上,但

不在网络农场。我无法控制这台服务器,但是网络主机已经试图解决问题了。
。然而,他们还没有提出解决方案。


可能导致这种情况的原因是什么?

I have a problem, mentioned here before, of Session and Application
variables disappearing at one site but not at others or on my development
computer.

The problem is illustrated by an example at
http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session,
Application and Cache variables on the first page and then on the second
page view them as the second page is refreshed every five seconds. Before
10 refreshes, the variables have disappeared. Strangely, at least to me,
the Session Id can still be retrieved. So, under what circumstances do you
retain the Session ID but lose the Session variables?

The pages are hosted on a Windows 2003 server in a shared environment, but
not on a web farm. I have no control over this server, but the web host has
tried to solve the problem. However, they have not produced a solution.

What could be causing this?

推荐答案

你存储和传递session_id?

介意的第一件事是检查IIS管理中的请求循环参数。检查

查看它是否设置得太低。如果session_id在缓存中,我的想法完全是错误的b $ b。发布该测试页的代码。这肯定有我的

利息。


问候


-

-----------

有TidBits吗?

在此处获取: www.networkip.net/tidbits

" William LaMartin" < LA ****** @ tampabay.rr.com>在留言中写道

新闻:#x ************** @ TK2MSFTNGP09.phx.gbl ...
Where are you storing and passing session_id? The first thing which comes to
mind is examining the request recycle parameter in IIS management. Check to
see if it is set too low. If session_id is in the cache, my idea is totally
wrong. Post your code for that test page. This has definitely got my
interest.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:#x**************@TK2MSFTNGP09.phx.gbl...
我遇到了问题会话和应用程序之前提到的变量在一个站点消失但在其他站点或在我的开发计算机上消失。

这个问题通过一个例子来说明/> http://www.lamartin.com/dotnet/sessiontestset.aspx ,我在第一页上设置Session,
Application和Cache变量然后在第二页上查看它们,因为第二页每五秒刷新一次。在刷新之前,变量已经消失。奇怪的是,至少对我来说,仍然可以检索会话ID。那么,在什么情况下,
你保留会话ID但丢失会话变量?

这些页面托管在共享环境中的Windows 2003服务器上,但是
不在一个网络农场。我无法控制此服务器,但网站主机
已尝试解决此问题。然而,他们还没有提出解决方案。

是什么导致这个?
I have a problem, mentioned here before, of Session and Application
variables disappearing at one site but not at others or on my development
computer.

The problem is illustrated by an example at
http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session,
Application and Cache variables on the first page and then on the second
page view them as the second page is refreshed every five seconds. Before
10 refreshes, the variables have disappeared. Strangely, at least to me,
the Session Id can still be retrieved. So, under what circumstances do you retain the Session ID but lose the Session variables?

The pages are hosted on a Windows 2003 server in a shared environment, but
not on a web farm. I have no control over this server, but the web host has tried to solve the problem. However, they have not produced a solution.

What could be causing this?



我不存储会话ID。在SessionTestView.aspx页面的每一页重新加载

时检索它。


这是在页面中设置会话和应用程序变量的代码/>
sessiontestset.aspx:


Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理Button1 。点击

申请表(" Text")=" ABCDEF"

会话(" Text")=" 12345"

Cache.Add(" Text"," STUVWXYZ",Nothing,DateTime.Now.AddMinutes(10),

TimeSpan.Zero,Caching.CacheItemPriority.AboveNormal,Nothing)

Response.Redirect(" SessionTestView.aspx")

End Sub


以下是显示页面信息的代码

SessionTestView.aspx(此页面每五秒重新加载一次):

Private Sub Page_Load(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理MyBase.Load

''将用户代码设置为初始化页面

Me.lblTime.Text = Now.ToString

Me.lblApplication.Text =" ;应用变量: &

应用程序(文本)

Me.lblSession.Text ="会话变量:" &安培;会话(文本)

Me.lblCache.Text =" Cached Variable:" &安培; Cache.Item(" Text")

Me.lblID.Text =" Session ID:" &安培; Session.SessionID.ToString

End Sub


" Alvin Bruney" < vapordan_spam_me_not@hotmail_no_spamhotmail.com>写在

消息新闻:OL ************** @ TK2MSFTNGP12.phx.gbl ...
I am not storing the Session ID. It is retrieved on every page reload of
the SessionTestView.aspx page.

Here is the code that sets the session and application variables in the page
sessiontestset.aspx:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Application("Text") = "ABCDEF"
Session("Text") = "12345"
Cache.Add("Text", "STUVWXYZ", Nothing, DateTime.Now.AddMinutes(10),
TimeSpan.Zero, Caching.CacheItemPriority.AboveNormal, Nothing)
Response.Redirect("SessionTestView.aspx")
End Sub

Here is the code that displays the information in the page
SessionTestView.aspx (this page reloads every five seconds):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
''Put user code to initialize the page here
Me.lblTime.Text = Now.ToString
Me.lblApplication.Text = "Application Variable: " &
Application("Text")
Me.lblSession.Text = "Session Variable: " & Session("Text")
Me.lblCache.Text = "Cached Variable: " & Cache.Item("Text")
Me.lblID.Text = "Session ID: " & Session.SessionID.ToString
End Sub

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:OL**************@TK2MSFTNGP12.phx.gbl...
你在哪里存储和传递session_id?
首先要考虑的是检查IIS管理中的请求循环参数。检查
以查看它是否设置得太低。如果session_id在缓存中,我的想法是
完全错误。发布该测试页的代码。这肯定引起了我的兴趣。

问候

-

----------- <获得TidBits?
在此处获取: www.networkip.net/tidbits
William LaMartin < LA ****** @ tampabay.rr.com>在消息中写道
新闻:#x ************** @ TK2MSFTNGP09.phx.gbl ...
Where are you storing and passing session_id? The first thing which comes to mind is examining the request recycle parameter in IIS management. Check to see if it is set too low. If session_id is in the cache, my idea is totally wrong. Post your code for that test page. This has definitely got my
interest.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:#x**************@TK2MSFTNGP09.phx.gbl...
我有一个问题,这里提到过,会话和应用程序的变量在一个站点消失但在其他站点或我的
开发计算机上消失。

问题通过
http://www.lamartin.com/dotnet/sessiontestset.aspx ,我在第一页上设置Session,
Application和Cache变量,然后在第二页上查看它们,因为第二页每五秒刷新一次。
在10次刷新之前,变量已经消失。奇怪的是,至少到
我,仍然可以检索会话ID。那么,在什么情况下
I have a problem, mentioned here before, of Session and Application
variables disappearing at one site but not at others or on my development computer.

The problem is illustrated by an example at
http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session,
Application and Cache variables on the first page and then on the second
page view them as the second page is refreshed every five seconds. Before 10 refreshes, the variables have disappeared. Strangely, at least to me, the Session Id can still be retrieved. So, under what circumstances do


保留会话ID但丢失会话变量?

页面托管在Windows 2003服务器上在共享环境中,
但不在Web场上。我无法控制这个服务器,但是web主机
retain the Session ID but lose the Session variables?

The pages are hosted on a Windows 2003 server in a shared environment, but not on a web farm. I have no control over this server, but the web host


试图解决问题。然而,他们还没有提出解决方案。

可能导致这种情况的原因是什么?
tried to solve the problem. However, they have not produced a solution.

What could be causing this?



确定在IIS中检查您的设置。如果这是IIS6,你想检查

应用程序池属性回收事件和应用程序关闭事件

以查看它们的设置。如果没问题,您需要在流程模型节点中查看

配置文件中的idletime指令,看看它们设置为什么
。如果可以,请转到机器配置文件并检查

httpruntime节点以查看回收指令


问候

-

-----------

有TidBits吗?

来这里: www.networkip.net/tidbits

" William LaMartin" < LA ****** @ tampabay.rr.com>在消息中写道

新闻:eA ************* @ tk2msftngp13.phx.gbl ...
ok check your settings in IIS. If this is IIS6 you want to check the
application pool properties recycle events and application shut down events
to see what they are set to. If this is ok, you will need to check your
config files for idletime directives in the process model node to see what
they are set to. If this is ok move on to the machine config file and check
the httpruntime nodes to see the recycling directives

regards
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:eA*************@tk2msftngp13.phx.gbl...
我没有存储会话ID。它是在SessionTestView.aspx页面的每个页面重新加载时检索的。

这是在
页面中设置会话和应用程序变量的代码sessiontestset.aspx: System.EventArgs)处理Button1.Click
Application(" Text")=" ABCDEF"
会话(" Text")=" 12345"
Cache.Add(" Text"," STUVWXYZ",Nothing,
DateTime.Now.AddMinutes(10),TimeSpan.Zero ,Caching.CacheItemPriority.AboveNormal,Nothing)
Response.Redirect(" SessionTestView.aspx")
End Sub

这是显示页面信息的代码< SessionTestView.aspx(此页面每五秒重新加载一次):

Private Sub Page_Load(ByVal sender As System.Object,ByVal e As
System.EventArgs)处理MyBase.Load
''将用户代码初始化这里的页面
Me.lblTime.Text = Now.ToString
Me.lblApplication.Text =" Application Variable:" &
Application(Text)
Me.lblSession.Text =" Session Variable:" &安培;会话(文本)
Me.lblCache.Text =" Cached Variable:" &安培; Cache.Item(" Text")
Me.lblID.Text =" Session ID:" &安培; Session.SessionID.ToString
End Sub

Alvin Bruney < vapordan_spam_me_not@hotmail_no_spamhotmail.com>在
消息新闻中写道:OL ************** @ TK2MSFTNGP12.phx.gbl ...
I am not storing the Session ID. It is retrieved on every page reload of
the SessionTestView.aspx page.

Here is the code that sets the session and application variables in the page sessiontestset.aspx:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Application("Text") = "ABCDEF"
Session("Text") = "12345"
Cache.Add("Text", "STUVWXYZ", Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero, Caching.CacheItemPriority.AboveNormal, Nothing)
Response.Redirect("SessionTestView.aspx")
End Sub

Here is the code that displays the information in the page
SessionTestView.aspx (this page reloads every five seconds):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
''Put user code to initialize the page here
Me.lblTime.Text = Now.ToString
Me.lblApplication.Text = "Application Variable: " &
Application("Text")
Me.lblSession.Text = "Session Variable: " & Session("Text")
Me.lblCache.Text = "Cached Variable: " & Cache.Item("Text")
Me.lblID.Text = "Session ID: " & Session.SessionID.ToString
End Sub

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:OL**************@TK2MSFTNGP12.phx.gbl...
你在哪里存储和传递session_id?
的第一件事是
Where are you storing and passing session_id? The first thing which comes
介意检查IIS管理中的请求回收参数。检查
mind is examining the request recycle parameter in IIS management. Check


查看它是否设置得太低。如果session_id在缓存中,我的想法是
see if it is set too low. If session_id is in the cache, my idea is


完全

错误。发布该测试页的代码。这肯定引起了我的兴趣。

问候

-

----------- <获得TidBits?
在此处获取: www.networkip.net/tidbits
William LaMartin < LA ****** @ tampabay.rr.com>在消息中写道
新闻:#x ************** @ TK2MSFTNGP09.phx.gbl ...
wrong. Post your code for that test page. This has definitely got my
interest.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"William LaMartin" <la******@tampabay.rr.com> wrote in message
news:#x**************@TK2MSFTNGP09.phx.gbl...
我有一个问题,这里提到过,会话和应用程序的变量在一个站点消失但在其他站点或在我的开发计算机上消失。

这个问题通过一个例子来说明
http://www.lamartin.com/dotnet/sessiontestset.aspx ,我设置了
第一页上的Session,Application和Cache变量,然后在
第二页上查看它们,因为第二页每五秒刷新一次。在10次刷新之前,变量已经消失。奇怪的是,至少在我看来,仍然可以检索会话ID。那么,在什么情况下
I have a problem, mentioned here before, of Session and Application
variables disappearing at one site but not at others or on my development computer.

The problem is illustrated by an example at
http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session, Application and Cache variables on the first page and then on the second page view them as the second page is refreshed every five seconds. Before 10 refreshes, the variables have disappeared. Strangely, at least to me, the Session Id can still be retrieved. So, under what circumstances do you
保留会话ID但丢失会话变量?

页面托管在共享环境中的Windows 2003服务器上,但不是在网络农场。我无法控制这个服务器,但是web
retain the Session ID but lose the Session variables?

The pages are hosted on a Windows 2003 server in a shared environment, but not on a web farm. I have no control over this server, but the web


主机有

试图解决问题。但是,他们没有制作
tried to solve the problem. However, they have not produced a



解决方案。
是什么导致了这个?


solution.
What could be causing this?




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

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