note 79414 deleted from function.header by danbrown
| From: | danbrown@php.net | Date: | Sun, 07 Dec 2008 18:09:15 +0000 |
| Subject: | note 79414 deleted from function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147804@lists.php.net to get a copy of this message | ||
Note Submitter: onge
----
I experienced some problem with session and header('Location:') redirect. I have used
session to store message to be displayed after redirect.
For that purpose I have class that load message data from session, unset this session and print
message output and this is on each page.
There was an problem that when unset($_SESSION['name']) was there, then no data was been
forewarded, if unset was commented, then everything works fine.
So, I did it that way:
<?php
header('Location: ./');
exit;
?>
...and it works. exit; after redirect is the key. I spent about 4 hours on that, so I hope this will
save time to someone else.