title: Cookie doesn't get deleted with xml callback jquery php
body: <p>I'm not sure if somebody asked this already, at least i cant find the answer so i'm wondering what i'm doing wrong with my script.</p>
  
  <p>I'm trying to delete a cookie with a callback done by Jquery that calls a php script on the background, BUT, whatever i try i cannot get this to properly work (deleting the cookie). </p>
  
  <p>I've checked the php website and even looked at the RFC 2109 memo to find out how browsers and php try to accomplish that the cookie will be deleted.</p>
  
  <p>So, my question here is; How can this fail? </p>
  
  <p>Edit: i don't get any error message, deleting the cookie manually works and creating the cookie with the same type of callback done by jquery does also work. It just doesn't get deleted when i try the same callback with jquery to run the PHP script in the background in order to delete the cookie.</p>
  
  <p>Code for that JQ callback action:</p>
  
  <pre><code>$(document).ready(function() {
  var alert = $('#Cmessage'); 
  
  $(".delete").on('click', function(){
  
  $.ajax({
    url: 'http://www.oostpijl.nl/shop/offerte/deletecookie.php',
    type: 'get', // form submit method get/post
    dataType: 'json', // request type html/json/xml
    beforeSend: function() {
      alert.fadeOut();
    },
  success: function(result) {
      if(result.error){
          alert.html(result.html).fadeIn();
          console.log(e)
      }else{
          alert.html(result.html).fadeIn();
          }
      }
  });
  });
  });
  </code></pre>
  
  <p>PHP script:</p>
  
  <pre><code>&lt;?php
  include("_offertesettings.php");
  if( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ){   
      setcookie('offerte', '', time() - 3600, '/' , '.oostpijl.nl' );
      setcookie('offerteC', '', time() - 3600, '/', '.oostpijl.nl' );
  $result = array("error" =&gt; false, "html" =&gt; null);
  $result["error"] = false;
  $result["html"] = "&lt;script type='text/javascript'&gt;setTimeout(function() { window.location='" . $config["BURL"] . "'; }, 10);&lt;/script&gt;";
  } else {
      $result["error"] = true;
      $result["html"] = "&lt;h3&gt;Error; Neem contact op met de webmaster&lt;/h3&gt;";
  }
  echo json_encode($result);
  exit; 
  ?&gt;
  </code></pre>