Title: Debug warnings in file wp-cache-phase2.php
Last modified: November 6, 2022

---

# Debug warnings in file wp-cache-phase2.php

 *  Resolved [Dani](https://wordpress.org/support/users/adorablepaws/)
 * (@adorablepaws)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/)
 * I use WP Super Cache on four websites. All of them show this warning, if debug
   is set to true:
 * Warning: preg_grep(): Compilation failed: missing terminating ] for character
   class at offset 19 in /users/xx/folder/wp-content/plugins/wp-super-cache/wp-cache-
   phase2.php on line 1748
 * Warning: Cannot modify header information – headers already sent by (output started
   at /users/xx/folder/wp-content/plugins/wp-super-cache/wp-cache-phase2.php:1748)
   in /users/users/xx/folder /wp-content/plugins/wp-super-cache/wp-cache-phase2.
   php on line 1478
 * This happens with php 7.4 and 8.0. The only reference I see in the warnings is
   the wp-cache-phase2.php. I also double checked the entries in wp-config and htaccess.
   Everything seems to be correct.
 * I know it’s “only” a warning, but I’d appreciate your help to get rid of the 
   warning.

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

 *  Plugin Contributor [Mark (a11n)](https://wordpress.org/support/users/thingalon/)
 * (@thingalon)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/#post-16179951)
 * Hi [@adorablepaws](https://wordpress.org/support/users/adorablepaws/),
 * Thanks for the issue report.
 * Line 1748 in wp-cache-phase2.php is where Super Cache applies the “Rejected Cookies”
   setting from the “Advanced” tab in your Super Cache settings. Each line in that
   setting is treated as a Regular Expression, so if you have a stray “[” character
   in there it might get confused.
 * Can you please check your Rejected Cookies setting, and make sure there are no
   square brackets or other special characters included?
 * If you need help sorting out a complex Rejected Cookie setting using a Regular
   Expression, please let me know what settings you are aiming for and I can guide
   you on how to set it up.
 *  Thread Starter [Dani](https://wordpress.org/support/users/adorablepaws/)
 * (@adorablepaws)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/#post-16179985)
 * Hi [@thingalon](https://wordpress.org/support/users/thingalon/) ,
 * these are my excluded cookies:
    woocommerce_cart_hash woocommerce_items_in_cart
   wp_woocommerce_session_ woocommerce_recently_viewed store_notice[notice id]
 * If I understood it correctly, the ] of the last one store notice could be causing
   the error? I actually don’t even remeber adding that last line. However, I’ll
   delete it and we’ll see whether the warning still comes up.
 *  Plugin Contributor [Mark (a11n)](https://wordpress.org/support/users/thingalon/)
 * (@thingalon)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/#post-16179989)
 * Hi [@adorablepaws](https://wordpress.org/support/users/adorablepaws/),
 * I think the issue is in the last two lines:
 *     ```
       store_notice[notice
       id]
       ```
   
 * It looks like it’s supposed to search for “store_notice[noticeid]” in your cookies.
   If you change that to “store_notice\[noticeid\]” (all on one line), it should
   resolve the issue.
 * Be sure to include that backslashes `\`, as it will tell Super Cache that you
   want to match with an exact “[” character, and it won’t get it confused with 
   a Regular Expression control character.
    -  This reply was modified 3 years, 7 months ago by [Mark (a11n)](https://wordpress.org/support/users/thingalon/).
    -  This reply was modified 3 years, 7 months ago by [Mark (a11n)](https://wordpress.org/support/users/thingalon/).
 *  Thread Starter [Dani](https://wordpress.org/support/users/adorablepaws/)
 * (@adorablepaws)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/#post-16180001)
 * Yes, it’s now working fine with no more warnings. I just deleted the whole store_notice
   line.
 * Thank you for your help [@thingalon](https://wordpress.org/support/users/thingalon/).
   Much appreciated!

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

The topic ‘Debug warnings in file wp-cache-phase2.php’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Dani](https://wordpress.org/support/users/adorablepaws/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/debug-warnings-in-file-wp-cache-phase2-php/#post-16180001)
 * Status: resolved