COOKIES headers already sent
<p>I have probelm with COOKIE. </p>

<p>Error: </p>

<blockquote>
  <p>Cannot modify header information - headers already sent by (output started at /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php:1) in /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php on line 43</p>
</blockquote>

<p>Index:</p>

<pre><code>&lt;?php
session_start();
error_reporting(E_ALL);
require_once('_libs/_console.php');
require_once('_libs/class.phpmailer.php');
require_once('_libs/_lib.php');
//require_once('_libs/PasswordLib.phar');

$db = new database();
$func = new functions($db);
$cms = new CMS_system($func, $db);


$func-&gt;setLang();
</code></pre>

<p>The file _lib.php starts with <code>&lt;?php</code> and there is no whitespace at the start. That file contains classes and functions. </p>

<p>Function setlang:</p>

<pre><code>    public function setLang() {

    setcookie("lang", "sk", time()+60*60*24*30);
    if (isset($_POST['lang'])) {
        setcookie("lang", $_POST['lang'], time()+60*60*24*30);
    }

}
</code></pre>

<p>I tried deleting session_start from script but that does not work. Thanks for any comments or solutions</p>
