Typically, the cookie ( Cookies) collection property is read-only (at least when using the ASP.NET property Response.Cookies).
, HttpListener, , Cookies , cookie? , cookie, cookie?
:
-, HttpListener, , .
cookie, http :
Set-Cookie: username=shiv
- :
Set-Cookie: username=shiv;
expires=Thu, 27-Jan-2011 00:45:41 GMT;
path=/
? ...
2:
, Expiration . ASP.NET , .
Http :
context.Response.Headers.Add("Set-Cookie",
"username=shiv; expires=Thu, 27-Jan-2011 00:45:41 GMT; path=/");
context - HttpListenerContext.
, ( ) cookie HttpListener. DateTime , :
var cookieDate = DateTime.UtcNow.AddMinutes(60d).ToString("dddd, dd-MM-yyyy hh:mm:ss GMT");