In this recipe, we will learn how to use the
cookies-file command-line switch to specify the location of the file for persistent cookies in PhantomJS.
To run this recipe, we will need a script to run with PhantomJS that accesses a site where cookies are read or written. We will need a filesystem path to specify it as the command-line argument, making sure that we have write permissions to that path.
The script in this recipe is available in the downloadable code repository as
chapter01. If we run the provided example script, we must change to the root directory for the book's sample code.
Lastly, the script in this recipe runs against the demo site that is included with the cookbook's ...