Invalid value for encryptedTicket parameter

前端 未结 4 1240
离开以前
离开以前 2021-02-20 10:34

I recently modified the login for my companies eComm site to have a \"Keep me logged in\" feature. The primary change was to make the forms authentication cookie persistent for

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-20 11:02

    This happens if you pass an invalid string to System.Web.Security.FormsAuthentication.Decrypt. Most commonly its trying to pass in cookieName instead of cookieValue.

    The following is the way to get the ASPXAUTH cookie value + info:

    string authCookieValue = HttpContext.Request.Cookies[FormsAuthentication.FormsCookieName].Value;
    var cookieInfo = System.Web.Security.FormsAuthentication.Decrypt(authCookieValue);
    

提交回复
热议问题