cookies error in login form when destroyed
<p>I am trying to set cookies to remember the users login details if they tick the 'remember me' box in the login form. I have managed to do this, however when I destroy the cookies by unticking the box, the login fields will both have undefined index errors in them the next time they try and login. How do I get rid of these errors when the cookie has been destroyed?
here is the code for the cookies from my login.php:</p>

<pre><code>if(isset($_POST['keep'])){
    setcookie("blarg",$_POST["email"],time()+3600);
    setcookie("bloof",$_POST["password"],time()+3600);
}else{
    setcookie("blarg","",time()-3600);
    setcookie("bloof","",time()-3600);
}
</code></pre>

<p>and here is the code to display the cookie data in my login form on my index page:</p>

<pre><code>&lt;input type="text" name="email" id="email" required="required" value="&lt;?php echo $_COOKIE["blarg"] ?&gt;"/&gt;
&lt;br /&gt;

&lt;label&gt;Password&lt;/label&gt;
&lt;input type="password" name="password" id="password" required="required" value="&lt;?php echo $_COOKIE["bloof"] ?&gt;"/&gt;
&lt;br /&gt;
</code></pre>

<p>Also this is just for a uni project, so it doesn't matter that the password is stored in a cookie, because I know that would be insecure in the real world.</p>