Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Deleting Cookies?

  • 16-04-2002 11:34AM
    #1
    Registered Users, Registered Users 2 Posts: 4,228 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 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