Okay, i figured out the answer to my last question too. Now i have a new problem. I used the codes below and they work fine in firefox and chrome, but as usual not in Explorer (its a piece of ****, you know)
<script>document.cookie ='chat=sesion; path=index.php';</script>
document.cookie='chat=;expires=Thu, 01-Jan-70 00:00:01 GMT;';
window.onunload = clearCookie;
I would appreciate a cross-browser solution.