我有一个由Web应用程序和多个项目组成的解决方案,是否可以在所有解决方案中共享Web应用程序中的配置?
谢谢
我使用表单身份验证在我的网站上创建了一个登录,我不明白为什么在创建故障单并将其添加到cookie之后
如果我检查 HttpContext.Current.Request.IsAuthenticated
我弄错了.仅在连续请求时,用户才能进行身份验证
这是我的代码
var fat = new FormsAuthenticationTicket(
1,
username,
DateTime.Now,
DateTime.Now.AddMinutes(20),
rememberMe,
contact.Id + "," + contact.Role.Id,
FormsAuthentication.FormsCookiePath);
HttpContext.Current.Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(fat)));
Run Code Online (Sandbox Code Playgroud)
在这一点,如果我检查HttpContext.Current.Request.IsAuthenticated我得到假,我认为这一点用户被认证...
这是我的配置
<authentication mode="Forms">
<forms loginUrl="/Admin/Login.aspx" name="FormAuthentication" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
谢谢.