Title is ignored
<?
session_start();
$id = $_SESSION['id'];
$email = $_COOKIE['email'];
$password = $_COOKIE['password'];
header('Location: ../');
// I tell it to redirect...
$cookie_expires = time() + 60*60*24;
$cookie_path = '/';
$cookie_name = 'temporary';
$cookie_value = 'Your account was deleted.';
setcookie($cookie_name, $cookie_value, $cookie_expires, $cookie_path);
// ...but the cookie is set!
?>
<!-- Why? -->
+2
source to share
4 answers
You have error reporting disabled, which will help you deal with syntax error and should always be done in the dev environment.
ini_set('display_errors',1);
error_reporting(E_ALL & ~E_NOTICE);
EDIT: There was a double semicolon syntax error, but seems to have been fixed
you also need to call exit()
after your header or script execution stops and the cookie is set
0
source to share