Cookies in ASP.NET Core rc2

后端 未结 1 964
生来不讨喜
生来不讨喜 2021-01-20 16:06

Can someone pls explain how to store and get cookies in an ASP.NET Core rc2 application? I can only find outdated information about the old HttpContext.Response.Cookie

1条回答
  •  野性不改
    2021-01-20 16:24

    For getting request cookie value:

    HttpContext.Request.Cookies[""]
    

    Setting response cookie:

    HttpContext.Response.Cookies.Append("", , )
    

    0 讨论(0)
提交回复
热议问题