#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    London, England
    Posts
    251
    Rep Power
    15
    I'm writing a Perl CGI script that allows users to login using a web form then stores their password in a temporary cookie. No problems with that.

    I'm also aware that this cookie will be deleted when the user closes their browser, as it's been set without an expiration date.

    However, I'd like to find a way of deleting the cookie from within a script, allowing an explicit "log out" function on the site, rather than depending on the user shutting down their browser to delete the cookie.

    Web mail providers seem to do something like this, though whether they're using the same technology I don't know.

    Any ideas?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    12
    Rep Power
    0
    I'm not really sure about this, but I've heard that if you send a cookie with the same name, but an expired expiration date, it will overwrite the old cookie, and then the browser will delete it because it has expired.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    12
    Rep Power
    0
    Just so you know, I went ahead and tested it and it worked fine for me.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    London, England
    Posts
    251
    Rep Power
    15
    Many thanks for your help. I tried it and it works fine.

    Like most things, the answer is almost obvious once you know it! :-))


IMN logo majestic logo threadwatch logo seochat tools logo