基于asp.net,C#和SQL Server-2005的Web应用程序中的意外注销 [英] Unexpected logout in my web application based on asp.net, c# and sql server-2005

查看:94
本文介绍了基于asp.net,C#和SQL Server-2005的Web应用程序中的意外注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,

我发现基于asp.net,C#和MS sql server-2005的网站正面临意外注销.在我的测试服务器中,这个问题不存在,一切正常.但是在托管服务器中,用户经常会在没有任何正当理由的情况下登出.请帮帮我.

问候:
Arun

Dear Sir,

I am observing that my web site, which is based on asp.net, C# and MS sql server-2005, is facing unexpected logouts. In my test server, this issue is not existing.Every thing is working fine. but in hosting server, user gets logged out very frequently without any valid reason. Please help me.

Regards:
Arun

推荐答案

由于ASP.NET辅助进程的重新启动,这很有可能.重新启动此过程并且您没有使用DBMS支持的会话状态时,所有会话信息都将丢失.因此,在您的应用程序中似乎该用户尚未登录.

在此处阅读: http://www.xefteri.com/articles/show.cfm?id=14 [^ ]
此处: http://msdn.microsoft.com/zh-CN/library/aa720473(v = vs.71).aspx [ ^ ]


另请参阅我对以下问题的回答:对象参考未设置为对象实例 [ ^ ]

最好的问候,

-MRB
This is most likey due to restarting of the ASP.NET worker process. When this process is restarted and you are not using a DBMS backed session state all session information will be lost. So it will seem to your application that the user has not yet logged in.

Read here: http://www.xefteri.com/articles/show.cfm?id=14[^]
and here: http://msdn.microsoft.com/en-us/library/aa720473(v=vs.71).aspx[^]


See also my answer on this question: object reference not set to instance of object[^]

Best Regards,

-MRB


在web.config中使用此代码将起作用

< sessionstate mode ="StateServer" cookieless ="false" timeout ="20">
use this code in web.config it will works

<sessionstate mode="StateServer" cookieless="false" timeout="20">


这篇关于基于asp.net,C#和SQL Server-2005的Web应用程序中的意外注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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