c# - Cookie timing question -
when add cookie through response.cookies.add(cookie);
cookie not placed on clients side until client requests page site. @ time of request .net magic, place cookie in response , client store it. is true? if above assumption true should able see unplaced cookies cookie = response.cookies("foo")
. seems logical, correct?
to sum up.
i placing cookie, later in code before request served checking if cookie in request.cookies("foo"
) if not checking response.cookies("foo")
. method not work. how go reading cookie before sent client side.
the actual question need answered; is there way view cookies information before send browser? along lines of check if cookie on browser if not other check see if waiting sent.if waiting sent read data on it
thank much.
if understood question correctly want add cookie httpresponse
@ point after receiving request client. @ later point of processing request want access same cookie again.
this quote might you:
"after add cookie using
httpresponse.cookies
collection, cookie available inhttprequest.cookies
collection, if response has not been sent client."
(from http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cookies.aspx)
i suggest process cookie @ 1 point during response. can check if it's available in httprequest
, , if not add httpresponse
, invoke additional logic.
Comments
Post a Comment