diff --git a/CookieAwarePageCache.inc b/CookieAwarePageCache.inc
index a7e7109..9c32a5d 100644
--- a/CookieAwarePageCache.inc
+++ b/CookieAwarePageCache.inc
@@ -16,6 +16,10 @@ class CookieAwarePageCache extends DrupalDatabaseCache implements DrupalCacheInt
   function prepare_cid($cid) {
     // Make sure we only alter the CID for the page cache.
     if ($this->bin == 'cache_page') {
+      // Do not alter $cid in these cases, we probably want to empty cache_page.
+      if ($cid == '*' OR is_null($cid)) {
+        return $cid;
+      }
       $cookies = variable_get('cookie_aware_page_cache_cookies', array());
       foreach ($cookies as $cookie_name) {
         if (isset($_COOKIE[$cookie_name])) {
