Help with ASP and cookies

Discussion in 'Computer Science & Culture' started by BloodSuckingGerbile, Mar 7, 2003.

Thread Status:
Not open for further replies.
  1. BloodSuckingGerbile Master of Puppets Registered Senior Member

    Messages:
    440
    I have a problem.
    Every time I try to set cookies with ASP commands, an automatically set cookie appears in addition to the ones I've set. It's source is, I think, is the ASP session. As soon as an ASP session starts, this cookie appears. As soon as I end the ASP session, the cookie disappears. Because of this cookie, I cannot check if there are cookies set by using the

    if (document.cookie=="")

    statement, because document.cookie always contains a value of that ASP cookie even if I didn't set any cookies, and there are not supposed to be any.
    Now, the weird thing is that at school it works fine and the server doesn't add any additional cookies. Only the ones I set.
    At home there is this one cookie that pisses me off.
    Please, if anybody knows what to do and how to get rid of that cookie, share your knowledge with me. I would be extremely grateful, because I have to have my project finished till the next week.
    P.S. If it helps, I'm using PWS as a server (as well as my school) and Visual Interdev 6.0 (also as well as my school).
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Stryder Keeper of "good" ideas. Valued Senior Member

    Messages:
    13,105
    It might help if your sourced your Code.

    That way anyone that might be able to help can work out wether or not it's your coding or a misconfiguration of the server.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. BloodSuckingGerbile Master of Puppets Registered Senior Member

    Messages:
    440
    d=new Date
    d.setYear(d.getYear()+1)
    document.cookie="first_n="+document.hid.first.value+";expires="+d.toGMTString()
    document.cookie="last_n="+document.hid.last.value+";expires="+d.toGMTString()
    document.cookie="email="+document.hid.email.value+";expires="+d.toGMTString()

    *document.hid.X are hidden text fields that contain info from three session variables.

    This is a part of an ASP page that inserts info into a database and then sets a cookie for the current user (after a registration form). I doubt it'll help, because I'm pretty sure that it's not the coding. It did work in my school, remember? If it is a misconfiguration of the server, what can I do to fix it?

    Anyway, I've overcome this problem by splitting the cookie and checking if the name of the first cookie is "first_n", not checking if document.cookie is empty, but I still would like to know what the problem is.

    Thanks for answering.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. BloodSuckingGerbile Master of Puppets Registered Senior Member

    Messages:
    440
    Ok. I have one more question...

    What is the right syntax of the SQL Update statement?

    The textbook my teacher gave me has the general form of the statement, but for some unknown reason the PWS keeps telling me

    So I would really appreciate a little help.
    Thanx.
     
  8. choler Registered Member

    Messages:
    16
Thread Status:
Not open for further replies.

Share This Page