diff --git a/CookieAwarePageCache.inc b/CookieAwarePageCache.inc
index a7e7109..083b3e8 100644
--- a/CookieAwarePageCache.inc
+++ b/CookieAwarePageCache.inc
@@ -37,7 +37,10 @@ class CookieAwarePageCache extends DrupalDatabaseCache implements DrupalCacheInt
   }
 
   function clear($cid = NULL, $wildcard = FALSE) {
-    $cid = $this->prepare_cid($cid);
+    // Do not alter $cid if we are about to empty cache_page.
+    if ($cid !== '*' OR !is_null($cid)) {
+      $cid = $this->prepare_cid($cid);
+    }
     parent::clear($cid, $wildcard);
   }
 }
