Title: PHP Cookie accepted code not working
Last modified: October 9, 2019

---

# PHP Cookie accepted code not working

 *  Resolved [greenlightpete](https://wordpress.org/support/users/greenlightpete/)
 * (@greenlightpete)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-cookie-accepted-code-not-working/)
 *     ```
       if ( function_exists('cookie_accepted') && cookie_accepted() ) {
           // Your code
       }
       ```
   
 * This code does not not work in my template

Viewing 1 replies (of 1 total)

 *  Plugin Author [Marco Milesi](https://wordpress.org/support/users/milmor/)
 * (@milmor)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/php-cookie-accepted-code-not-working/#post-12045292)
 * Hi,
    this is plain PHP and should work out of the box as the EU Cookie Law plugin
   is activated. Please try to turn off cache systems, if present. If the issue 
   persists you should contact your theme vendor to investigate further.

Viewing 1 replies (of 1 total)

The topic ‘PHP Cookie accepted code not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/eu-cookie-law_39293e.svg)
 * [EU Cookie Law for GDPR/CCPA](https://wordpress.org/plugins/eu-cookie-law/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eu-cookie-law/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eu-cookie-law/)
 * [Active Topics](https://wordpress.org/support/plugin/eu-cookie-law/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eu-cookie-law/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eu-cookie-law/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Marco Milesi](https://wordpress.org/support/users/milmor/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/php-cookie-accepted-code-not-working/#post-12045292)
 * Status: resolved