Perhaps some kind of offtopic, the reason why the author noted that he uses php to run the test.
But if you came from Google and are interested in a C # solution to clear all cookies, look below:
// driver is fully initialized PhantomJS instance driver.Manage().Cookies.DeleteAllCookies();
NuGetPackages required:
PhantomJS 2.0.0
Selenium.Support 2.48.2
Selenium.WebDriver 2.48.2
Tested with .NETFramework v4.5.2
source share