title: Codeception Acceptance and Phantomjs Cookies outside your domain (Google oAuth)
body: <p>I am at a crossroad where I have the "solution" but I am not sure its the best approach.</p>
  
  <p>Part of my application is oAuth login and I want to test that too (Acceptance).
  I have bogus accounts for my oAuth providers that i'll be using to Login. Problem is Cookies.</p>
  
  <p>I am using Phantomjs. Even if I use  clear_cookies: true on my yml file I have this problem where my test cannot login because Google remembers me.
  The test is quite simple:</p>
  
  <pre><code>public function login_with_oauth(AcceptanceTester $I)
  {
    $I-&gt;amOnPage('/auth/logout');
    $I-&gt;amOnPage('/');
    $I-&gt;click(['id' =&gt; 'login']);
    $I-&gt;click(['id' =&gt; 'btn_login_google']);
  
    @$I-&gt;fillField(['id' =&gt; 'Email'], $this-&gt;login);
    $I-&gt;fillField(['id' =&gt; 'Passwd'], $this-&gt;password);
    $I-&gt;click(['id' =&gt; 'signIn']);
  
    $I-&gt;waitForText($this-&gt;name);
    $I-&gt;seeInCurrentUrl('/home');
  }
  </code></pre>
  
  <p>First time it works, second it does not because Google remembers the logged in user so it doesnt show the login and password boxes anymore.</p>
  
  <p>If I hit the google logout url (accounts.google.com/logout) it logs the user out, but the next time I try to login it will remember my EMAIL (thus not my password), the email field will be greyed out (disabled) so Codeception can't fill it and goes bananas.</p>
  
  <p>Even if clear_cookies: true worked I would run into a problem where, for all my other test Cests that share the same Session, I would have to login _before(), which would add about 20% more time to run the tests.</p>
  
  <p>The solution I've came up with: is to simply restart phantom before each test. Since phantom is managed by supervisord it is as easy as having a alias in my ~/bashrc, like so:</p>
  
  <pre><code>alias codecept=' supervisorctl stop phantomjs &amp;&amp; supervisorctl start phantomjs &amp;&amp; vendor/bin/codecept'
  </code></pre>
  
  <p>That way I can keep my cookies between each test and I can make sure my oAuth providers cookies are also cleared.</p>
  
  <p>I also tried restarting phantom from within php on the __construct of the oAuth cest but that makes Codecept throw some weird errors.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks and best regards.</p>