Title: [Plugin: WP Super Cache] BUG: RewriteCond %{HTTP_COOKIE}..
Last modified: August 19, 2016

---

# [Plugin: WP Super Cache] BUG: RewriteCond %{HTTP_COOKIE}..

 *  [jayant](https://wordpress.org/support/users/jayant/)
 * (@jayant)
 * [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/)
 * The plugin writes the line:-
 * `RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$`
 * Also, WordPress is creating a cookie:-
 *     ```
       Name	wordpress_test_cookie
       Value	WP+Cookie+check
       Host	MY_HOST_NAME_SNIPPED_INTENTIONALLY
       Path	/
       Secure	No
       Expires	At End Of Session
       ```
   
 * When the user has only this cookie, because of the above line in .htaccess, the
   page skips the super cache and only uses the WP cache.
 * I am not sure generally what all other cookie names are used by wordpress in 
   order to write the new rule, but we surely need to exclude the above mentioned
   cookie.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/#post-764947)
 * That’s not too much of a problem because it’s set only if someone tries to login.
   Presumably the user has a reason for logging in and they’ll succeed in which 
   case they won’t see supercached pages anyway.
 *  [baptiste](https://wordpress.org/support/users/baptiste/)
 * (@baptiste)
 * [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/#post-765026)
 * Some plugins also set this cookie. It took me a while to finally realize my super
   cache was never being used. After the first hit on my site, users never use the
   super cache again.
 * sidebarLogin widget is one such plugin.
 * I worked around it by changing the test cookie in wp-config:
    define(‘TEST_COOKIE’,‘
   wp_test_cookie’);
 * and it fixed the problem (only in v2.3 or higher!!!), but it’s still sort of 
   a hack. The new rewrite rules seem to be too broad. What was wrong with checking
   for the more specific cookies matches like
 * RewriteCond %{HTTP_COOKIE} !^.*comment_author_.*$
    RewriteCond %{HTTP_COOKIE}!
   ^.*wordpressuser.*$ RewriteCond %{HTTP_COOKIE} !^.*wp-postpass_.*$
 *  [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/#post-765028)
 * WP 2.5 and up don’t use the wordpressuser cookie any more so thats why it changed.
 * I’ll update the README with a warning to change the test cookie if there are 
   problems with caching.
 *  [baptiste](https://wordpress.org/support/users/baptiste/)
 * (@baptiste)
 * [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/#post-765029)
 * I’m not a mod_rewrite guru, but I’d think there would be some way to check for
   wordpress_ hash cookies that aren’t called wordpress_test_cookie. Would solve
   the problem for plugins and users hitting the login page. If I have some time
   I’ll try to play with some different rules.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: WP Super Cache] BUG: RewriteCond %{HTTP_COOKIE}..’ is closed
to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [baptiste](https://wordpress.org/support/users/baptiste/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/plugin-wp-super-cache-bug-rewritecond-http_cookie/#post-765029)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
