It looks like there is another piece to the puzzle. Where is: $_SESSION['redirect'] set?
Can I see a copy of the set_sessions.php page? That might help as well.
It might also help if you could remind me of exactly why we added the code. What effect were you attempting to accomplish? There might be another technique to use with the new server behaviors.