almut-behrens at gmx.net
Fri May 14 19:46:13 EST 2004
On Thu, May 13, 2004 at 04:17:29PM -0400, Becky L. Norum wrote:
> Is there any way of removing a cookie from a browser before the browser is
> closed? I know that if you set the expiration date to an earlier date it
> will delete the cookie when the browser is closed.
There's not much to add to what Douglas already said... Except setting
the cookie to an empty value, there isn't much you can do.
Even if there was some trick to achieve immediate removal for one
browser, it probably wouldn't work portably across different browsers.
If you're concerned about the cookie still existing (for privacy
reasons, like disclosing what sites the user has been visiting, or
whatever else), but don't really have a specific reason for storing
the cookies persistently in the first place, you might consider using
transient 'session cookies' instead (created by _not_ setting the
expiration date). This would nicely circumvent having the cookies on
disk at all, as they'll only be kept in memory then.
Btw, what exactly is it that you want to achieve, i.e. why does it
matter that the cookie is not deleted immediately? Maybe there are
alternative ways to approach the problem...
More information about the Programming