title: Deleting cookies file after CasperJS script finished
body: <p>I want to use <code>fs</code> library to create a file at the begin of my script and delete it at the end. The <code>cookies.txt</code> file is created at the begin but not deleted at the end of the script..</p>
  
  <pre><code>phantom.cookiesEnabled = true;
  var fs = require('fs');
  var cookies = JSON.stringify(phantom.cookies);
  fs.write("cookies.txt", cookies, 777); // THIS WORKS !!
  
  casper.start('http://google.fr/', function(){
      this.viewport(320, 480);
  });
  // my script ....
  casper.then(function(){
      fs.remove("cookies.txt"); // THIS NOT WORKS !!
  });
  casper.run(function() {
      this.test.done();
      this.exit();
  });
  </code></pre>
  
  <p>The command I write to start the script</p>
  
  <pre><code>casperjs test lbc.js --cookies-file=cookies.txt --web-security=no
  </code></pre>