PHP session destroyed / lost after header

I've never seen any session related issues due to using location headers - are you sure you're calling session_start on both pages?


Hmm... this answer made a lot more sense before you added the session_start bits above, and mentioned the fact that you were sure you were using session_start. :-)


header must be sent before session close

session_regenerate_id(true);

header("Location: /");
// the header must be sent before session close
session_write_close(); // here you could also use exit();