setting a cookie after include("file")
<p>I have a login script and I log users that fail excessively.  In my debugging purposes I have it logging after the first try fail or not. </p>

<p>I tested the code by visiting it. I named the file fail_cookie.php.  When I visit it from the browser it sets the cookie just fine. However if I am on a login form called login.ws and I have this code: </p>

<pre><code>if (!isset($_COOKIE["login"])) {
        logUser($_POST['username'], $_POST['password'], time(), $_SERVER['REMOTE_ADDR']);
        include "fail.ws";
    }
</code></pre>

<p>Inside <code>fail.ws</code> is where I set the <code>fail_cookie.php</code>.  I include this inside the <code>&lt;head&gt; .. .. &lt;?php include("fail_cookie.php"); ?&gt; &lt;/head&gt;</code></p>

<p>The cookie is never set when I am redirected to <code>fail.ws</code> by <code>login.ws</code>.  </p>

<p>This code used to work on my last host but it doesn't work on my current host. Is it my host that is the problem or is it mine? If it is mine can someone point some advice to me?</p>

<p>Thanks.</p>
