【问题标题】:Does CreateUserWizard call FormsAuthentication.SetAuthCookie?CreateUserWizard 是否调用 FormsAuthentication.SetAuthCookie?
【发布时间】:2009-10-13 23:40:58
【问题描述】:


1) 我假设当 CreateUserWizard.LoginCreatedUser 设置为 true 时,控件会调用 FormsAuthentication.SetAuthCookie,这反过来会创建身份验证票证(我很确定控件不会调用 FormsAuthentication.RedirectfromLoginPage )


2) 来自 MSDN:

当 LoginCreatedUser 属性设置为 true 时,将在 CreateUserStep 步骤结束时创建并登录用户。

我不认为这是真的,因为当页面显示 CompleteWizardStep 时,用户还没有登录?!


感谢

【问题讨论】:

    标签: asp.net asp.net-membership forms-authentication


    【解决方案1】:

    使用 Reflector 我可以看到它在 CreatingUser 事件触发后立即调用了FormsAuthentication.SetAuthCookie(username, false);

    所以它让用户登录,但没有持久性 cookie。

    【讨论】:

    • 只有在下一次回发时用户才登录(因此将创建用户的安全上下文),因此页面已经显示 CompleteWizardStep?!
    • 嗯,这是一种可能性,我不确定。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-11
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多