When to use Request.Cookies over Response.Cookies?

后端 未结 6 589
囚心锁ツ
囚心锁ツ 2020-12-02 07:30

Do I use response when at a page event (e.g. load) as this is a response from ASP.NET, and request when pressing a button as this is a response going to ASP.NET for processi

6条回答
  •  醉话见心
    2020-12-02 08:23

    When i create or update a cookie in .NET i normally do it to both the request and response cookie collection. That way you can be sure if you try to read the cookie further down the page request sequence it will have the correct information.

提交回复
热议问题