- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 VS2013 RC 和 MVC 5 构建一个网站,并且正在尝试使用 formsAuthentification 而没有在我的网站上注册永久用户。
我发布到我公司的 api 以验证用户名和密码。当这成功返回时,我想发出一个授权cookie:
System.Web.Security.FormsAuthentication.SetAuthCookie(username, false);
最佳答案
我需要在 web.config 中启用表单例份验证
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
...
</system.web>
关于forms-authentication - (Request.IsAuthenticated) 在使用 FormsAuthentication.SetAuthCookie(username,false) 后为假,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19280829/
所以,我在 Controller 中有代码: FormsAuthentication.SetAuthCookie("hello", true);throw new Exception("" + Use
我正在尝试在新环境中设置我的网站,但我遇到了成员(member)提供商的问题。 我可以调用 Membership.ValidateUser,它应该返回 true 和 false。太完美了。 但是,在我
您好,我正在对我的 ASP.Net MVC2 项目进行一些单元测试。我正在使用最小起订量框架。在我的 LogOnController 中, [HttpPost] public ActionResult
在检查用户的凭据并确认它们是正确的之后,我使用 FormsAuthentication.SetAuthCookie("Username", false); 来验证用户。 然后在母版页中,我使用 Pag
我正在开发一个 asp.net mvc 应用程序并创建了我的自定义用户数据库和注册程序(需要电子邮件验证)。我可以将 FormsAuthentication.SetAuthCookie 与我自己的登录
我有一个网络应用程序可以安装在很多域和路径上。 所以: client1Name.{mySite.com} client2Name.{mySite.com} 演示。{mySite.com}/prospe
我正在使用 createuserwizard 控件。在 CreatedUser 事件中,我放置了此代码以将用户添加到角色。 protected void RegisterUser_Create
我首先要说的是,也许这有点矫枉过正。 在我的登录例程中,我在使用 FormsAuthentication.SetAuthCookie 之前加密了用户的登录 ID。 问题是,如果加密字符串最终包含转义字
我正在使用 aspx 和 c# 为登录设置身份验证 cookie。 FormsAuthentication.SetAuthCookie(UserName, True) 我想在同一个 cookie 中存
我似乎找不到这个看似简单的问题的答案。 使用第一个或后者有什么区别?为什么我要使用第一个? 在 MSDNAA 上,我发现以下有关 Formsauthentication.setCookie() 的内容
因此 StackOverflow 上有很多关于此的帖子,但我仍然无法解决我的确切问题。这是要点: 我有一个需要身份验证的网站。我正在使用标准的 .NET FormsAuthentication.Set
我有一些代码用于创建身份验证票证。创建票证后,我们调用SetAuthCookie来设置cookie,例如: FormsAuthentication.SetAuthCookie(username, tr
在我的 MVC 3 应用程序中,我有一个非常基本的 Controller [HttpPost] public ActionResult SignIn(LogonModel logonModel) {
我有一些代码可以用来创建身份验证票证。创建票证后,我们调用 SetAuthCookie 来设置 cookie,例如: FormsAuthentication.SetAuthCookie(usernam
我在测试中使用了 Form Authentication。还有一些测试用户名。但发现指定名称的奇怪问题。这是所有测试名称,只有一个名为 amybeyond 的名称可以在测试中使用。 请帮助检查我的测试
我正在尝试使用基本表单例份验证实现 ASP.NET MVC5 应用程序。所以有我的登录方法: [HttpPost] [AllowAnonymous] public Action
问题一: setAuthCookie 是否比 FormsAuthentication.Encrypt(ticketVariable) 更不安全? 我的意思是,如果有人试图通过修改用户名来修改 setA
好的,我很困惑,asp.net 中的 FormsAuthentication.SetAuthCookie() 是否创建基于 session 的 cookie?从我收集到的将一些东西放入 session
我发现 FormsAuthentication.SetAuthCookie 抛出 NullReferenceException - 未将对象引用设置为天蓝色网站上的异步操作内的对象实例。 我发现了以下
很抱歉,如果这已经被覆盖,但我要拔掉我的头发。我的网站正在使用表单例份验证,当我在//localhost 上测试时它运行良好,但是当我发布到网络时它在 IE9 中不起作用。我已按照教程中列出的所有步骤
我是一名优秀的程序员,十分优秀!