日志在重新启动应用程序池后,奇怪的行为 [英] Strange behavior of log on after restart application pool

查看:91
本文介绍了日志在重新启动应用程序池后,奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立使用表格验证一个简单的asp.net MVC3应用程序。它发布到IIS 7.5后,我发现我重新启动我的网站的应用程序池即使(停止,然后开始)。一个logined用户不需要重新登录。这不是我所期望的,我不记得我已经配置了cookie的是持久的。

我用简单的asp.net MVC3 Web应用程序模板,并没有做很多的事情来配置认证。下面是一些codeS身份验证有关的:

在web.config中:

 <身份验证模式=表格>
  <形式loginUrl =〜/帐号/登录超时=2880/>
< /认证>

在LogOn支持行动:

  FormsAuthentication.SetAuthCookie(用户名,虚假);


解决方案

我想我已经得到了答案,Cookie设置在客户端和,因为它是不可用在服务器上重置IIS服务器不会破坏该cookie。您可以设置cookie的到期时间,它会在客户端side.I得到破坏希望这将清除的情况。

I am building a simple asp.net mvc3 application using Form authentication. After publishing it to IIS 7.5, I find that even after I restart the application pool for my web site(stop it and then start). A logined user doesn't need to re-login. That's not what I expect and I don't remember I had configured the cookie to be persistent.

I use the simple asp.net mvc3 web application template and haven't done much thing to config authentication. Below is some codes related to authentication:

in web.config:

<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>

in LogOn action:

        FormsAuthentication.SetAuthCookie(userName, false);

解决方案

I think I have got your answer, cookie is set at client side and resetting server IIS will not destroy the cookie as it is not available on server. You can set cookie expiration time and it will get destroy at client side.I hope this clears the situation.

这篇关于日志在重新启动应用程序池后,奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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