this is my code in logout.php
<?php
if(isset($_COOKIE['cookie-username']) || isset($_COOKIE['cookie-password'])) {
setcookie("cookie-username", NULL, time()-60*60*24*100);
setcookie("cookie-password", NULL, time()-60*60*24*100);
}
header( 'Location: ../login' ) ;
?>
I can confirm the cookies exist, If I do a while loop I get
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 79 bytes) in /home/ios/public_html/logout.php on line 5
which means It cannot delete the cookies... I've done a lot of googling, but I can't figure out why it won't delete said cookies...
Help? Thanks In Advance
edit: proof of cookies: http://cl.ly/1c31120de4b722518b05
creation of cookies:
if (isset($_POST['submit'])) {
try {
if (!isset($_POST['username']) || !isset($_POST['password']) || trim($_POST['username']) =='' || trim($_POST['password']) =='') { throw new Exception('All Fields Are Required!');
}
$username = strtolower($_POST['username']);
$password = md5(strtolower($_POST['password']));
include('classes/config.php');
[SQL REMOVED]
foreach ($pdo->query($sql) as $row) {
$dbPassword = $row['password'];
}
if (!isset($dbPassword)) {
throw new Exception('Invalid Username or Password!');
}
if ($dbPassword == $password) {
if (!isset($_COOKIE['cookie-username']) || !isset($_COOKIE['cookie-password'])){
$days = 1;
if (strtolower($_POST['remember']) == 'on') {
$days = 30;
}
setcookie("cookie-username", $username, time()+60*60*24*$days, "/");
setcookie("cookie-password", $password, time()+60*60*24*$days, "/");
}
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=../index">';
}
else if ($dbPassword != $password) {
throw new Exception('Invalid Username or Password!');
}
}
catch (Exception $e) {
$exception = $e->getMessage();
}
}