<?
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? -->
<? session_start(); $id = $_SESSION[‘id’]; $email = $_COOKIE[’email’]; $password = $_COOKIE[‘password’]; header(‘Location: ../’); //
Share
Script execution continues after setting a
Location:header (or any other call toheader(), for that matter). If you want the redirect to happen immediately, without the rest of the script executing,return;ordie;immediately after you callheader().