Will setcookie work if there is a cache plugin installed?

A cache plugin in WP will cache PHP output, but does it include HTTP header? For example, add a piece of code as following:

add_action('wp', 'my_cookie' );
function my_cookie() {
    setcookie('my_cookie', 'value');
}

Will my_cookie be saved to client browser when served by cached page?

Read more here: Will setcookie work if there is a cache plugin installed?

Leave a Reply

Your email address will not be published. Required fields are marked *