Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: delete cookies when browser window closed

by pajout (Curate)
on Jul 28, 2010 at 07:32 UTC ( [id://851672]=note: print w/replies, xml ) Need Help??


in reply to delete cookies when browser window closed

What about setting cookie with expiration in the past on unload event?
  • Comment on Re: delete cookies when browser window closed

Replies are listed 'Best First'.
Re^2: delete cookies when browser window closed
by afoken (Chancellor) on Jul 28, 2010 at 21:39 UTC

    No Javascript, no event handler, no deleted cookie. Plus unload event handlers are not very reliable. Leaving out the expiration date just works (even with killall -9 $browsername), no need for Javascript.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      I agree, afoken, but the onunload stuff I thought should be pretty good... it's included in most core libs (basically because of IE6's memory leak... you had to manually unload everything or as the user went from page to page, IE6 would get full and puke). Hm, though that's usually all IE-only code...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://851672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-20 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found