Day 10 Q & A session

Results 1 to 2 of 2

Thread: Day 10 Q & A session

  1. #1
    Join Date
    Dec 1969

    Default Day 10 Q & A session

    Q.2: Determine cookie acceptance:<BR>As suggested in the book, I created a page Acceptcookies.asp wherein a cookie called "Test" with a value of "testing" was created and was redirected to page "DetermineCookieAcceptance.asp".<BR>Determinecooki eAcceptance.asp tries to read the cookie and if not an empty string the user accepts cookies. But when I used the code if len(response.cookies("Test") = 0 then display result using response.write stt. I get the following message:<BR>Microsoft VBScript runtime error &#039;800a01b6&#039; <BR><BR>Object doesn&#039;t support this property or method <BR><BR>/my web/Determinecookieacceptance.asp, line 6 <BR>Where am I going wrong?<BR><BR>Asha

  2. #2
    Join Date
    Dec 1969

    Default RE: Day 10 Q & A session

    You should be checking the Request.Cookies collection. Response.Cookies is used for writing cookies to the client, and is read-only. So your code should look like:<BR><BR>If Len(Request.Cookies("Test")) = 0 then<BR> ... no cookie support ...<BR>Else<BR> ... cookie support ...<BR>End If<BR><BR>hth, and Happy Programming!

Posting Permissions

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