I'm googling trying to find a solution to my problem.
I need to set a cookie in a diferent file and i'm trying with curl_setopt but it doesnt work.
Any way the idea is send with PHP the value to set cookie in another page, something like this:
    file1.php
    <? //start php
    //at the begining of the file i have
session_start();
header('Content-Type: text/html; charset=utf-8');
//if i set a cookie now it give me an error cause i can not change the header
//but because i need to set a cookie now without leaving this file
//i tryed to set it in file2.php this way:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $SITE_HOME_DIR ."login.php");
// Do a POST
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'email=pok@pok.com'); 
curl_close($ch);
    ///end php
    ?>
    file2.php
    <?
//just set cookie
setcookie("TestCookie", $_POST['email'], time()+3600)
?>
But this doesn'work....
Any ideas? Thank you.
 
     
    