In classic ASP, when I am setting a cookie using Response.Cookies("data1") = "value1" then I am able to read this cookie using Request.Cookies("data1") on the same page
But when I am using the syntax Response.AddHeader "Set-Cookie", "data2=value2" then I am not able to read this cookie using Request.Cookies("data2") on the same page.
So What is the difference between these two syntaxes of setting cookie and if I want to read the cookie using the second syntax how sould the read statement look like
Response.AddHeaderadds the headers during the response (data back to the client) whereasResponse.Cookiespre builds the collection before the response is sent, then setsset-cookieHTTP header when sending the response, this means until the response is sent there is time to modify the cookie collection. - user692942