Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Deleting Cookies?

Options
  • 16-04-2002 11:34am
    #1
    Registered Users Posts: 4,222 ✭✭✭


    I'm working on an web asp application that uses a cookie to store some info about a user when they have logged in to the asp application. (Not invasive, just stuff they'll need to actually use the application)
    Creating the cookie on login is fine but i can't seemd to remove or delete the cookie at all once they go to log out.

    I'm mainly using VBscript for the asp pages.

    Any help would be appreciated.


Comments

  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    cookies are always a bit of a pain, but depending on how you initialised it, it should just be a case of setting the expiry date to some date in the past.

    if you want an exact answer post up your code where you create the cookie.


  • Closed Accounts Posts: 28 eating




  • Registered Users Posts: 476 ✭✭Pablo


    Originally posted by eating
    http://javascript.about.com/cs/cookies/

    well worth a read chum :D
    good tutorial there mate


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Use the Session object - the lifespan of the cookie becomes immaterial then as once you abandon the session, the ID in the cookie will become invalid.


  • Registered Users Posts: 706 ✭✭✭DJB


    A view ways to do this...

    Set the cookie first with code like this:

    response.cookies("security")("username") = Request.Form("username")
    response.cookies("security")("password") = Request.Form("password")

    When you want to delete the cookie you can use code like this:

    response.cookies("security")("username") = ""
    response.cookies("security")("password") = ""

    This will leave the cookie on the users machine but delete the contents of the cookie. Modify the above to suit your needs.

    Regards,

    Dave


  • Advertisement
Advertisement