setcookie ajax php issue
<p>I want to set cookie through AJAX. But I get warning "Cannot modify header" any ideas ?</p>

<pre><code>&lt;?php 

if($_POST['name']){
   setcookie("autosave_blogo_id", "value", time()+10800, '/');
}

?&gt;
$("#button").click(function(){
                    $.ajax({
                    var indata = $('#b_pav').val();
                        type: "POST",
                        url:  "&lt;?php echo "http://" . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?&gt;",
                        data: indata,
                        success: function(msg){
            alert(msg);
                        }
                    });
                    return false;
                });
</code></pre>
