生产服务器上得很快形成即将过期的饼干 [英] Form Cookie Expiring too soon on production server

查看:180
本文介绍了生产服务器上得很快形成即将过期的饼干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的web.config设置

i have following settings in web.config

<authentication mode="Forms">
      <forms loginUrl="~/Account/login"   
       slidingExpiration="true" timeout="2880" protection="All" />
 </authentication>

但该Cookie中不活动的不到五分钟过期。对正在发生的事情任何线索?

but the cookie expires in less than five minutes of inactivity. Any clue on what is happening?

推荐答案

我承认从一个虚拟主机这种行为,我跑我的网站之一。移动到新的服务器,为ppared 4 DOTNET的Web.config $ P $完全被忽略,正如你提到的五分钟似乎是突破点,当这一切开始了。

I recognize this behavior from a web host where I run one of my sites. It all started when moving to new servers, prepared for dotNET 4. The web.config is completely ignored and, as you mention, five minutes seems to be the break-point.

你的问题让我开始四处挖掘,寻找工作。我开始浏览表单的身份验证类别这里#2,您使用的标记之一。几分钟后,我发现了一个有点类似的问题:<一href=\"http://stackoverflow.com/questions/6269079/asp-net-forms-authentication-keeps-displaying-login-page\">ASP.NET表单验证一直显示登录页面。在接受的答案有人建议设置无Cookie =UseCookies

Your question made me start digging around, looking for a working. I started by browsing the forms-authentication category here on Stackoverflow, one of the tags you used. After a few minutes I found a somewhat similar question: ASP.NET forms authentication keeps displaying login page. In the accepted answer it was suggested to set cookieless="UseCookies.

我检查了我自己的web.config,发现无Cookie 被排除在外,回落的默认配置。快速编辑和一些测试给予了积极的结果。它的工作太棒了。但后来我编辑的文件回来,因为它是以前,现在有一个工作会议十年我们的。我添加了一个元刷新重新加载该页面每隔十分钟。也许托管公司已经调整了一些参数。可悲的是我对你没有办法解决:(

I checked my own web.config and found that cookieless was left out, falling back on the default configuration. A quick edit and some testing gave a positive result. It worked great. But then I edited the file back, as it was before and have now had a working session for ten ours. I added a meta-refresh which reloaded the page every ten minutes. Perhaps the hosting company have tweaked some parameter. The sad thing is I have no solution for you :(

而不是运行在随随Visual Studio Web服务器为您服务,尽量在IIS本地运行一下,看看是否可以重现该问题。

Instead of running your service in the web server shipped with with Visual Studio, try to run it locally in IIS and see if you can reproduce the issue.

(为了帮助用户回答这个问题,我想如果你提供有关生产服务器,组件版本和东西的一些信息,这将有助于。你运行像它的IIS版本,并且建立哪个框架版本。而且,您在测试中运行你的网站你使用IIS或Visual Studio中的轻型Web服务器?)

(To help users answer this questions I guess it would help if you provide some info about the production server, component versions and stuff. Like which version of IIS you're running and which framework version you build for. And, when you run your site in test do you use IIS or the light-weight web server in Visual Studio?)

这篇关于生产服务器上得很快形成即将过期的饼干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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