Archive for February, 2008

27 Feb

Session variables not set on following page after header() redirect

The main reason for this blog here is to share with others the problems I’ve encountered and solved in the hope of saving someone banging their heads on the wall trying to solve issues that are sometimes trivial but waste stupid amounts of time.

A problem I recently encountered is that after doing some PHP magic and then redirecting a user to another page, the following page loses all the session information set in the previous page. For hours I was there trying to figure out why this was happening, and hopelessly trawling the net for answers!

(more…)