English 中文(简体)
通过表Authentic建立的新陈规
原标题:Expire cookie set through FormAuthentication

我在Login使用成员SchipUser 标语,我们正在验证用户身份,并创建格式

FormAuthentication.SetAuth(username, false);

如今,如果用户不作标识并直接关闭浏览器。 签字 这种方法不使用。

因此,当我们重开网站时,用户已经陷入困境。

最佳回答

要么将时间分配价值与适当数目相混淆,要么使用较少形式的认证。

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="Login.aspx"
           protection="All"
           timeout="30" <----------------------------Tune this
           name=".ASPXAUTH" 
           path="/"
           requireSSL="false"
           slidingExpiration="true" <--------------------- Tune this
           defaultUrl="default.aspx"
           cookieless="UseDeviceProfile" <--------------------- Or Turn off cookies
           enableCrossAppRedirects="false" />
  </authentication>
</system.web>

http://msdn.microsoft.com/en-us/library/ff647070.aspx#pagexplained0002_cookielessforms

问题回答

认证表仍然有效。 当用户再次打开该网站时,厨师说,用户仍然gged。

你们可以让 co子活下来,这样它更有可能过期:

<authentication mode="Forms">
   <forms loginUrl="Login/" timeout="5"/>
</authentication>

但是,如果用户 does出其赢得的 t,就应立即停下来。

^ 除非你不使用厨师,否则(在确实看着非常 n的争.中穿透镜)。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签