
Files | 343
HttpRequest
Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Message.Text = "->" & strKey & "(" & strSubKey & _
") = " & Request.Cookies(strKey)(strSubKey).ToString( ) _
& "<br/>"
Next
End If
Next
To solve the first issue, we use the HttpCookie’s Value method to get the value of
the cookie as a string. The solution to the second issue is to call the Values prop-
erty of the HttpCookie instance, which allows us to retrieve the subkeys of a
dictionary cookie.
Another quirk of the change from the mostly text-based manipulation of cookie
keys and values in ASP to class-based manipulation in ASP.NET is that the
Expires property of the
HttpCookie class is available whether you read or write to a
cookie. In ASP, however, attempting to read the Expires property of a cookie
would result in an error. Unfortunately, at the time of this writing, the Expires
property of HttpCookie does not actually return the expiration of the cookie.
Instead, it returns the value 12:00:00 AM, which suggests that despite its read-
ability, the property is not designed to be read from.
Finally, unlike classic ASP, the collections in ASP.NET are zero-based, so the first
element in any collection or array is 0, not 1. This is especially important to
remember when retrieving values by their index.
Files
HttpFileCollection = Request.Files
The Files collection, ...