note 47383 deleted from ref.session by bjori

From: Date: Sat, 30 Dec 2006 16:33:31 +0000
Subject: note 47383 deleted from ref.session by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121096@lists.php.net to get a copy of this message
Note Submitter: Audun Rundberg ---- If you're using header('Location:' . $url) to redirect the user to another page, you should use session_write_close() to save session data before the redirect. $_SESSION is normally serialized and written to the harddrive when the script ends. Example: <?php $_SESSION["Message"] = "The task was completed."; session_write_close(); header('Location:' . $_SERVER["PHP_SELF"]); ?> Without session_write_close(), this next piece of code would not output "The task was completed". (Assuming that this code is in place where the user was redirected.) <?php echo $_SESSION["Message"]; ?>

« previous php.notes (#121096) next »