在与GoDaddy服务器一个应用程序MVC3不稳定会议 [英] Unstable session in a MVC3 application with godaddy servers

查看:127
本文介绍了在与GoDaddy服务器一个应用程序MVC3不稳定会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在godaddy的一个MCV3应用服务和会话很不稳定。当我登录它工作正常,但同时在应用程序导航它记录我出去,并创下刷新或只是这样导航多一点里面的应用程序日志中我(不要求凭证或其它)。在我的远程测试服务器,并在当地工作的罚款。

I have a MCV3 application in godaddy serves and the session is quite unstable. When I login it works fine but while navigating in the application it logs me out, and hitting refresh or navigating a little more inside the application in logs me in just like that(without asking credentials or anything). On my remote test servers and local in works fine.

推荐答案

这可能不是一个问题,会话,而是一个身份验证Cookie /票务问题。 GoDaddy的(最有可能)拥有自己的服务器负载均衡。也就是说你的应用程序实际上在同一时间多个服务器上存在。

This is probably not a session issue but rather an authentication cookie/ticket issue. GoDaddy (most likely) has their servers load balanced. Meaning that your application actually exists on more than one server at a time.

在你的web.config,如果你没有正确定义<&的machineKey GT; 属性,那么IIS弥补了你的机器密钥。运行应用程序的每个服务器都会做出自己的计算机密钥,如果它不是由您定义。这样一来,一台服务器能够解密和阅读您的身份验证票,而下一个请求进入,因为它是用不同的密钥加密,且该服务器认为你还没有登录不能解密验证票据的另一台服务器。

In your web.config, if you are not properly defining the <machineKey> attribute, then IIS makes up a machine key for you. Each server running the application will make their own machine key if it is not defined by you. As a result, one server is able to decrypt and read your authentication ticket, while the next request goes to another server which cannot decrypt the authentication ticket because it was encrypted with a different key and this server thinks that you are not logged in.

要解决这个问题,打开你的web.config文件,定义你的&LT;&的machineKey GT; 属性并重新部署。一旦你与新部署的应用程序登录,你应该看到这个问题消失。

To address this issue, open your web.config file and define your <machineKey> attribute and redeploy. Once you login with the newly deployed application, you should see this issue disappear.

<一个href=\"http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations\"相对=nofollow>窗体MSDN上认证和计算机密钥信息

Forms authentication and Machine Key information on MSDN

计算机密钥生成(最有可能的,每个人都将在这里应该使用.NET 2.0版本所生成)

Machine Key Generator (Most likely, everyone going here should use the .NET 2.0 version that is generated)

这篇关于在与GoDaddy服务器一个应用程序MVC3不稳定会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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