`
renzhelife
  • 浏览: 669934 次
文章分类
社区版块
存档分类
最新评论

ASP.NET forms authentication

 
阅读更多

To implement a form authentication, you need add the following code in web.config:



enableCrossAppRedirects means authenticated users in this application can be redirected to other applications as authenticated too.

<deny users="?" /> means that unauthenticated users (represented by "?") are denied access to resources in this application.


In default page:

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);set no browser cache.

FormsAuthentication.SignOut(); will remove authentication information from cookie for current user.

CookiesManager.RemoveAll(); will remove browser cookies for this application


In Login.aspx:


In Login.aspx.cs







分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics