Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cookies

Status
Not open for further replies.

theocraticmind

Programmer
Apr 19, 2002
318
CA
ok based on the tut on asp cookies at w3schools.com i came to the conclusion that in the following code, if the cookie was not already on the users machine, this would/should do fine. but this dosen't seem to be the case, seeing how i always get an "Element not found" error.

dim username
dim password

username = Request.Cookies("username") 'line that gives the error
password = Request.Cookies("password")

if username <> &quot;&quot; and password <> &quot;&quot; then
session(&quot;name&quot;) = username
session(&quot;password&quot;) = password
else
session(&quot;name&quot;) = &quot;&quot;
session(&quot;password&quot;) = &quot;&quot;
end if

anyway, how do i test for the cookie before i atempt to call it, so that i don't get this error?
 
try writing it to the page
response.write(Request.Cookies(&quot;username&quot;))
That may not be the right syntax but w3schools.com shows you how to do this. That will test to see if the cookie was added to the machine. provide tools to let people become their best.
 
it still didn't work. but i gave up and am prosessing the cookies in the index.asp file, and they are working fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top