Request.IsAuthenticated is always false

前端 未结 10 2163
迷失自我
迷失自我 2020-12-15 04:34

Can you tell me why FormsAuthentication.SetAuthCookie(user.Name, false); is not causing Request.IsAuthenticated to be true?

Here is my code

10条回答
  •  暖寄归人
    2020-12-15 05:10

    you must set FormsAuthentication.SetAuthCookie(acct.UserName, true); after validating user and please check you must set authentication mode="Forms" in web.config.

提交回复
热议问题