0
我使用FormsAuthentication.RedirectFromLoginPage(userName.Trim(), false);
来设置稍后引用的User.Identity.Name字段。当我执行这一行时,User.Identity对象根本不会更新;它包含之前设置的任何内容。我在网上看到的所有文档都表示这应该用正确的名称更新我的User.Identity对象,但我没有看到发生这种情况。RedirectFromLoginPage()不更新User.Identity.Name
我有web配置设置是否恰当下面几行:
<authentication mode="Forms">
<forms name="formsauth" loginUrl="Login.aspx" protection="All" timeout="60">
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
我是比较新的这个东西,所以任何帮助表示赞赏。谢谢!
谢谢Darin!后来我检查了同一个请求,以检查会话用户名是否与User.Identity.Name匹配,但我不确定它为什么在那里(我没有写它)。看起来像我应该能够把它拿出来。再次感谢! – Kevin 2010-06-02 20:31:34