I put simple php condition in the
header.php of template as this :
setcookie("test_time_".$cookie_id."", $cookies_times, time()+3600);
The result always as this headers already sent, I use this inside plugin and also I try outside the plugin and the result always the same.