Re: sessions broken when redirected?
| From: | Derek Sivers | Date: | Fri, 30 Mar 2001 06:48:42 +0000 |
| Subject: | Re: sessions broken when redirected? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46235@lists.php.net to get a copy of this message | ||
I had this same problem and it constantly broke our whole site.
So I tried a different approach and this has been working great:
Instead of <? header ("Location: sometoherpage.php"); ?>
Consider: <? include "someotherpage.php"; ?>
It works flawlessly, always, and maintains your session.
Because my site ( a shopping cart/store ) is so dependent on sessions, I stopped using redirects and "Location: " functions entirely.
We just use <? include "..." ?> now and all sessions work wonderfully. Even without cookies, etc.