Can't set cookies in a plugin (1 post)

  1. DarkWolfXP
    Posted 7 years ago #

    Hi, recently I made a plugin for wordpress just to try it out. However I can't set cookies in that plugin not sure why...

    function check()
    setcookie ("Verificar", "activo", time() - 86400);
    add_action('wp_footer', 'check');

    Basically this function sets a cookie and when it does it shows me an error :

    Warning: Cannot modify header information - headers already sent by (output started ...............)

    I would appreciate any help...

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic