Re: php-javascript-html
| From: | Mark Maggelet | Date: | Wed, 06 Dec 2000 18:23:29 +0000 |
| Subject: | Re: php-javascript-html | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28948@lists.php.net to get a copy of this message | ||
On Wed, 6 Dec 2000 12:32:57 -0500, Bravo, David (CORP, MTC)
(david.bravo@gemmc.ge.com) wrote:
>How do I destroy a session <?php session_destroy() ?> when I leave a
>page???
>I know I may use javascript...
>Regards.
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-
>admin@lists.php.net
if the session is in a cookie and you know the name of the cookie you
can do something like this:
<script language="javascript">
function session_destroy(){
document.cookie="<?echo $cookiename?>=0; expires=Thu, 01-Jan-70
00:00:01 GMT; path=/; domain=.mydomain.com";
}
</script>
<body onUnload="session_destroy()">