Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Examples: ASP Request Object Cookies Collection

The first example shows how to print the entire cookie collection:

<%
'Print out the entire cookie collection.
For Each cookie in Request.Cookies
  If Not cookie.HasKeys Then
    'Print out the cookie string
%>
    <%= cookie %> = <%= Request.Cookies(cookie) %>
<%
  Else
    'Print out the cookie collection
    For Each key in Request.Cookies(cookie) %>
      <%= cookie %> (<%= key %>) = <%= Request.Cookies(cookie)(key) %>
<%
    Next
  End If
Next
%>

The next example prints the value of a cookie variable called "myCookie":

<%= Request.Cookies("myCookie") %> 


ContentsPreviousNextIndex