I want to set cookie through AJAX. But I get warning "Cannot modify header" any ideas ?
<?php 
if($_POST['name']){
   setcookie("autosave_blogo_id", "value", time()+10800, '/');
}
?>
$("#button").click(function(){
                    $.ajax({
                    var indata = $('#b_pav').val();
                        type: "POST",
                        url:  "<?php echo "http://" . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>",
                        data: indata,
                        success: function(msg){
            alert(msg);
                        }
                    });
                    return false;
                });
 
     
    