Title: Problem with setCookie function in User.php
Last modified: December 6, 2023

---

# Problem with setCookie function in User.php

 *  Resolved [mativve](https://wordpress.org/support/users/mativve/)
 * (@mativve)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/problem-with-setcookie-function-in-user-php/)
 * Hello, in my debug logs I have this error:
 *     ```wp-block-code
       [05-Dec-2023 10:24:19 UTC] PHP Warning: Cannot modify header information - headers already sent in <_hosting_path_>/public_html/wp-content/plugins/da-reactions-premium/classes/DaReactions/User.php on line 50
       ```
   
 * Do you know any solution for this?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Daniele Alessandra](https://wordpress.org/support/users/danielealessandra/)
 * (@danielealessandra)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/problem-with-setcookie-function-in-user-php/#post-17256511)
 * Hello Mativve,
 * Thank you for using my plugin and for reporting this anomaly.
 * The plugin calls setcookie within a function hooked to the “init” hook, which
   should be entirely secure because at that point, no content should have been 
   sent.
 * The reason you’re getting this warning is that a plugin or theme you’re using
   is generating output earlier than expected. This could be due to an error or 
   incorrect programming practices.
 * On my end, with the next update, I will increase the execution priority of that
   function. I am also considering using the “wp” hook instead of “init”, but it
   seems like a too drastic solution. I will look for the best possible solution.
 * In the meantime, you can investigate the cause of the problem by identifying 
   the point where output is generated too early.
 * Thank you for your support.

Viewing 1 replies (of 1 total)

The topic ‘Problem with setCookie function in User.php’ is closed to new replies.

 * ![](https://ps.w.org/da-reactions/assets/icon-256x256.png?rev=2106671)
 * [Da Reactions](https://wordpress.org/plugins/da-reactions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/da-reactions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/da-reactions/)
 * [Active Topics](https://wordpress.org/support/plugin/da-reactions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/da-reactions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/da-reactions/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Daniele Alessandra](https://wordpress.org/support/users/danielealessandra/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/problem-with-setcookie-function-in-user-php/#post-17256511)
 * Status: resolved