Error when writing cookies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsmith76
    New Member
    • Dec 2011
    • 5

    Error when writing cookies

    I am getting the error: Type mismatch:'Expir es'
    Microsoft VBScript runtime error '800a000d'
    on this code:
    mailid and local_number are variable that are read from a form.

    <%response.cook ies("login")("m ailid")=mailid %>
    <%response.cook ies("login")("l ocal_number")=l ocal_number %>
    <%response.cook ies("login").Ex pires="Date + 7" %>

    First time I am using cookies. Puzzled with the error. Thanks, Dave
  • multinett
    New Member
    • Sep 2011
    • 16

    #2
    you just have to read the error message: "... mismatch:'expir es' ... "

    change <%response.cook ies("login").Ex pires="Date + 7" %> to <%response.cook ies("login").Ex pires=Date() + 7 %>

    i think that's the problem!

    Comment

    • dsmith76
      New Member
      • Dec 2011
      • 5

      #3
      Thanks, thought I tried it without the quotes, but I guess not.
      Another question, I am doing my login process for username and password using a form and then validating the info via the database running on sql server. I have read that I should not rely solely on cookies because some people disable them. With most browsers set to "autofill" are cookies becoming obsolete? Are they more for the benefit of the programmer, since they require less coding, or are there still good reasons to use them that benefit the end user?
      Thanks, Dave

      Comment

      Working...