--- fastpath_fscache.module.orig	2007-08-07 16:42:41.000000000 -0700
+++ fastpath_fscache.module	2007-08-07 16:59:17.000000000 -0700
@@ -87,3 +87,17 @@
     }
   }
 }
+
+function fastpath_fscache_user($type, $array, $user, $category) {
+  switch ($type) {
+    case 'login':
+      // Use this cookie to determine whether or not a user is logged in when 
+      // the fastpath is enabled (and thus shouldn't be served cached pages).
+      setcookie('drupal_uid', $user->uid, time() + (60 * 60 * 24 * 30), '/');
+      break;
+    case 'logout':
+      // When logging out, unset the cookie so the user can access cached pages.
+      setcookie('drupal_uid', $user->uid, time() - 60, '/');
+      break;
+  }
+}
--- cache.fs.inc.orig	2007-08-07 18:36:44.000000000 -0700
+++ cache.fs.inc	2007-08-07 18:36:15.000000000 -0700
@@ -1,5 +1,5 @@
 <?php
-// $Id: cache.fs.inc,v 1.7.2.6 2007/08/07 23:26:40 jeremy Exp $
+// $Id: cache.fs.inc,v 1.7 2007/07/30 21:25:50 weitzman Exp $
 
 /**
  * @file
@@ -265,27 +265,27 @@
  */
 function page_cache_fastpath() {
   global $base_root;
-  if (!empty($_POST)) {
-    // Someone is trying to submit a form, ie posting a comment.  We want Drupal
-    // to process the $_POST, so we don't return the cached version of the page.
-    return;
-  }
-  $file_cache = variable_get('fastpath_fscache_path', FASTPATH_FSCACHE_PATH);
-  if ($file_cache && is_dir($file_cache)) {
-    $cache = cache_get($base_root . request_uri(), 'cache_page');
-    if (!empty($cache)) {
-      // display cached page and exit
-      drupal_page_header();
-      if (function_exists('gzencode')) {
-        header('Content-Encoding: gzip');
+  if (empty($_POST) && !$_COOKIE['drupal_uid']) {
+    $file_cache = variable_get('fastpath_fscache_path', FASTPATH_FSCACHE_PATH);
+    if ($file_cache && is_dir($file_cache)) {
+      $cache = cache_get($base_root . request_uri(), 'cache_page');
+      if (!empty($cache)) {
+        // display cached page and exit
+        drupal_page_header();
+        if (function_exists('gzencode')) {
+          header('Content-Encoding: gzip');
+        }
+        print $cache->data;
+        return TRUE;
       }
-      print $cache->data;
-      return TRUE;
     }
   }
   else {
-    // Warning message that $file_cache isn't set. We don't have access to the
-    // t() function at this point.
-    //drupal_set_message(t('Cache error, failed to locate cache directory "%dir"', array('%dir' => $file_cache)), 'error');
+    // If $_POST is not empty, the user has submit a form (ie a comment was
+    // posted) so we don't serve the page from the cache, instead letting Drupal
+    // process the form submission.  If the 'drupal_uid' is set, a logged in
+    // user is viewing the page and so again we don't serve the page from the
+    // cache.
+    return;
   }
 }
