salve!
ho un problema nella gestione di un cookie.
in pratica quando l'utente fa il login devo impostare la città predefinita prendendola da db (la tabella ha un campo che serve a questo).
poi ogni volta che clicco su una città setto un cookie in base al parametro get passato.
avevo pensato di fare così:
Codice PHP:
if (!isset($_COOKIE['C'])) { // CONTROLLO SE IL COOKIE GIA ESISTE
    
foreach ($objConn->getSomething() as $var) {
        
$cittaPredef $var['id']; // PRENDO L'ID DEL RECORD PREDEFINITO
    
}
    
$_GET['c'] = $cittaPredef;
}

setcookie("C"$_GET['c'], time() + 2592000'/''www.sito.it'FALSETRUE); 
solo che ottengo questi errori:
codice:
Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.sito.it/htdocs/lib/conn.php:85) in /home/mhd-01/www.sito.it/htdocs/header.php on line 23