Cannot set cookie when page cache was enabled.
-
I created this simple plugin to make sure that cookie can be set but when page cache was enabled, it is not working.
<?php /** * Plugin Name: Test cookie with W3TC * Plugin URI: * Description: * Version: * Author: Vee W * Author URI: * License: MIT * License URI: https://opensource.org/licenses/MIT * Text Domain: test-cookie-w3tc * Domain Path: /languages/ * * @package test-cookie-w3tc */ add_action('init', 'testcookiew3tc'); function testcookiew3tc() { setcookie('testcookiew3tc', date('Y-m-d H:i:s'), 0, COOKIEPATH, COOKIE_DOMAIN); }
The W3TC plugin settings is all default with page cache enabled.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Cannot set cookie when page cache was enabled.’ is closed to new replies.