Session-vars with header() transfer

Having issues with $_SESSION[‘var’]’s not being saved after you redirect the user via header()? Add exit(); after the header() call.

Example:

$_SESSION['emailed'] = true;
header('Location: response.php');
exit();

Cheers!

1 thought on “Session-vars with header() transfer

Leave a Reply

Your email address will not be published. Required fields are marked *