Forums

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

  1. DarkWolfXP
    Member
    Posted 6 months 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

Reply

You must log in to post.

About this Topic