Article ID: 185978
Article Last Modified on 1/23/2007
<%@ LANGUAGE="VBSCRIPT" %>
<% ' Check for cookie and add if it does not exist
myCookie = Request.Cookies("mycookie")("test1")
If mycookie = "" Then
Response.Cookies("mycookie")("test1")="OK! The Cookie Exists"
End If
%>
<HTML>
<HEAD><TITLE>A Page That Sets a Temporary Session Cookie</TITLE></HEAD>
<BODY>
<%
If myCookie = "" Then
%>
Cookie Did Not Exist<P>
<%
Else
%>
Cookie Exists<P>
<%
End If
%>
<A HREF="MakeWordDoc.asp">Click Here</A>
</BODY>
</HTML>
As expected, the Web page will display "Cookie Did Not Exist" when first
visited. Subsequent visits and refreshes of the page will display "Cookie
Exists" because the session cookie has now been set in Internet Explorer
for that session.
<%@ LANGUAGE="VBSCRIPT" %>
<% Response.ContentType = "application/msword" %>
<% mycookie = Request.Cookies("mycookie")("test1") %>
<% ' Check For Cookie
If mycookie = "" Then
%>
Error - Cookie Did Not Exist
<%
Else
%>
OK! Cookie Exists.
<%
End If
%>
Keywords: kbhotfixserver kbqfe kbactivedocs kbbug kbfix kbie500fix KB185978