Checking for cookie Existing

Results 1 to 2 of 2

Thread: Checking for cookie Existing

  1. #1
    Join Date
    Dec 1969

    Default Checking for cookie Existing

    I want to check if a cookie exists on a person computer<BR><BR>If it is does not exist I want it to print "This is a Test"<BR><BR>Else<BR> Print "This is Not a Test"<BR><BR>End if<BR><BR>I have tried this conditions:<BR>If Request.Cookies("Location")("ZipCode") = "" Then<BR>...<BR>But I get a .NET Error which says ""<BR>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <BR><BR>Exception Details: System.NullReferenceException: Value null was found where an instance of an object was required<BR><BR>The source o the error is this line:<BR>If Request.Cookies("Location")("ZipCode") = "" Then<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Checking for cookie Existing

    try...<BR><BR>If Request.Cookies("Location") Is Nothing then

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts