| | |
how to destroy the cookies when the browser is closed?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2007
Posts: 205
Reputation:
Solved Threads: 11
how to destroy cookies when the browser is closed? i have a php script where initially the user logs in and then the subsequent pages are displayed.i want that if the user closes the browser in between n tries to re-open the same page, he gets the error message that he has to login first (i.e the cookies which i have set once the user is logged in shud be destroyed once the user closes the browser.I am able to destroy my cookie after log out,but don't know how to destroy this when I will close the browser.
Last edited by carobee; Feb 12th, 2008 at 2:37 am.
•
•
Join Date: Dec 2007
Posts: 205
Reputation:
Solved Threads: 11
i figured out a javascript to use with php, but here agn i am not sure where to place the code for erasing the cookies. also in my page there are links to other pages, so everytime i click on any link, the message pops up. how cn i avoid that?
PHP Syntax (Toggle Plain Text)
<html> <body> <script language="JavaScript"> var needToConfirm = true; window.onbeforeunload = confirmExit; function confirmExit() { if (needToConfirm) return "Are you sure you want to exit?"; } </script> </body> </html>
Last edited by carobee; Feb 12th, 2008 at 6:25 am.
![]() |
Similar Threads
- At Wit's End: Some Webpages Don't Load; Can Ping Some Sites, Not Others (Viruses, Spyware and other Nasties)
- SECT UP FREE - 100% CPU on XP (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: installation
- Next Thread: Output Images using PHP
| Thread Tools | Search this Thread |
apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl database date display dynamic echo email error fcc file files folder form forms freelancing function functions google href htaccess html image include incode insert integration ip javascript joomla limit link login mail match menu method mlm mod_rewrite multiple mysql oop pageing pagerank paypal pdf php problem query radio random recursion recursiveloop remote script search server sessions sms smtp soap source space sql strip_tags subversion support! survey syntax system table template tutorial undefined update upload url validator variable video virus web window.onbeforeunload=closeme; youtube





