I have created a cookie by using jQuery. I want to delete the cookie with jQuery when the browser closes. How do I do this?
I\'ve written the following script:
If you want delete cookie when you close browser than you should set a session cookie, which automatically expires when browser closed. But if you want delete cookie when you close a tab than you should use window.unload and window.beforeunload events, write a function to delete necessary cookies and attach to these events.