I log people out of my admin section of my site with the following code: (My admin interface uses frames and session cookies for logon. I am somewhat sloppy with my cookie use, but it worked very well with ASP, and since I am porting it over I have just ported my current system. Also, have VERY limited needs for security on the pages I do secure with this method.)
Click on the link: "logout". Ex:
<a href="logout.php" target="_parent">Logout</a>
---file---
<?php
//reset cookies
setcookie("cookiename[priv]");
setcookie("cookiename[user]");
//relocate
header("Location:index.php");
?>
---end---
As usual be very careful with whitespace, since the header is very picky. Replace index.php with whatever site you wish them to go to.