System.Web Namespace HttpCookieCollection Class
Gets the cookie with the specified name from the cookie collection. This property is overloaded to allow retrieval of cookies by either name or numerical index.
In [ C# ], this property is the indexer for the HttpCookieCollection class.
1. Gets the cookie with the specified numerical index from the cookie collection.
2. Gets the cookie with the specified name from the cookie collection.
The following example gets the cookie with the name "LastVisit" and extracts its value.
NOTE: This example shows how to use one of the overloaded versions of the Item property ( HttpCookieCollection indexer ). For other examples that might be available, see the individual overload topics.
[ VB ]
Dim last As String = Request.Cookies ( "LastVisit" ).Value
[ C# ]
String last = Request.Cookies [ "LastVisit" ] .Value;
HttpCookieCollection Members