NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HttpRequest.Cookies

Gets a collection of client's cookie variables.

[Visual Basic]
Public ReadOnly Property Cookies As HttpCookieCollection
[C#]
public HttpCookieCollection Cookies {get;}
[C++]
public: __property HttpCookieCollection* get_Cookies();
[JScript]
public function get Cookies() : HttpCookieCollection;

Property Value

A managed reference to an HttpCookieCollection object representing client's cookie variables.

Example

<%
' This example loops through all cookies sent by the client and 
' sends the name, expiration date, security parameter,  and values 
' of each cookie to the Http output.
Dim vAllCookies, vThisCookie, vThisCookieValues, iCount, iCount2
' Capture all cookie names into an object array.
vAllCookies = request.Cookies.allKeys
' Grab individual cookie objects by cookie name.
For iCount=0 to Ubound(vAllCookies)
   vThisCookie = request.Cookies.item(vAllCookies(iCount))
   Response.Write("Cookie: " & vThisCookie.Name & ":<br>")
   Response.Write("Expires: " & vThisCookie.Expires & "<br>")
   Response.Write ("Secure:" & vThisCookie.Secure & "<br>")
'  Grab all values for single cookie into an object array.
   VThisCookieValues = vThisCookie.Values.All
   ' Loop through cookie Value collection and print all values.
   For iCount2=0 to Ubound(vThisCookieValues)
      Response.Write("Value" & iCount2 & ": " _
         & vThisCookieValues(iCount2) & "<br>")
   Next iCount2
next iCount
%>

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace