--- boost.module~	Mon Nov 23 20:27:07 2009
+++ boost.module	Tue Nov 24 21:16:21 2009
@@ -161,6 +161,10 @@
  */
 function boost_init() {
   global $user, $base_path;
+
+  // remove cookie set at logout
+  if ($_COOKIE[BOOST_COOKIE] == 0) boost_set_cookie(0, BOOST_TIME - 86400);
+
   // Disable all caches when nocache is set
   if (isset($_GET['nocache'])) {
     $GLOBALS['conf']['cache'] = CACHE_DISABLED;
@@ -808,7 +812,8 @@
       boost_set_cookie($user);
       break;
     case 'logout':
-      boost_set_cookie($user, BOOST_TIME - 86400);
+      // set the cookie to 0, then remove at the following request, this way browsers won't show a cached logged in page
+      boost_set_cookie(0);
       break;
     case 'delete':
       // Expire the relevant user page from the static page cache to prevent serving stale content:
@@ -2843,7 +2848,8 @@
   if (!$expires) {
     $expires = ini_get('session.cookie_lifetime');
     $expires = (!empty($expires) && is_numeric($expires)) ? BOOST_TIME + (int)$expires : 0;
-    setcookie(BOOST_COOKIE, $user->uid, $expires, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure') == '1');
+    $uid = $user ? $user->uid : 0;
+    setcookie(BOOST_COOKIE, $uid, $expires, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure') == '1');
   }
   else {
     setcookie(BOOST_COOKIE, FALSE, $expires, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure') == '1');
