HttpCookie.Name Property
.NET Framework 2.0
Gets or sets the name of a cookie.
Namespace: System.Web
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example receives a cookie collection from the client in the Cookie header and loops through the collection looking for a cookie with the specific name.
int loop1;
HttpCookie myCookie;
HttpCookieCollection myCookieCollection;
myCookieCollection = get_Request().get_Cookies();
for (loop1 = 0; loop1 < myCookieCollection.get_Count(); loop1++) {
myCookie = myCookieCollection.get_Item(loop1);
if (myCookie.get_Name().equals("UserName")) {
//...
}
}
var myCookie : HttpCookie var myCookieCollection : HttpCookieCollection myCookieCollection = Request.Cookies for(var i = 0; i < myCookieCollection.Count; i++){ myCookie = myCookieCollection[i] if(myCookie.Name == "UserName"){ //... } }
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show: