Results 1 to 4 of 4

Thread: Cookie error: Who can help?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking

    When a user enters on the registration page I am setting cookies at the top of my html as follows:

    <%Response.Cookies("ReclaimAmerica").Expires = Date+365
    Response.Cookies("ReclaimAmerica").Secure = FALSE
    Response.Cookies("ReclaimAmerica")("FirstName") = name1.value
    Response.Cookies("ReclaimAmerica")("LastName") = name.value
    Response.Cookies("ReclaimAmerica")("EmailAddress") = Session("NewUserEmail")


    Error Type:
    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'name1'

    My name1 is the name I assigned to the textbox.

    What is the error looking for? What is the object?

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810

    Exclamation No form object used!

    You must have a form object also:
    Code:
    <html>
    <body>
    <form name="oForm" method="post">
    <Input type="text" name=oName></input>
    </form>
    </body>
    </html>
    when you reference the object use:
    Code:
    Response.Cookies("ReclaimAmerica")("FirstName") = oForm.oName.Value
    OK
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Talking

    Thanks it works!

    Now when I try display the user's name on another screen it also works

    BUT

    if I leave the site and then come back the cookie has stopped displaying the information previously stored.
    When I look into the cookie the values are gone!

    How do I preserve the values from being destroyed?

  4. #4
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810

    Date formating in Expires!

    I assume you have cookies enabled in IE?
    Try to use an expiry date as follows:
    Code:
    <%
    Response.Cookies("ReclaimAmerica").Expires = DateAdd("m", 12, Now())
    %>
    I'm not sure the syntax you have used is valid.
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

Posting Permissions

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



Click Here to Expand Forum to Full Width