Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 707

PHP session destroyed / lost after header [closed]

$
0
0

I've got a script that sets some session values before redirecting to / using header().

I've read many posts about the $_SESSION variable being destroyed / lost after header(), even after I implemented this:

// set session heresession_regenerate_id(true);session_write_close();header("Location: /");

session_start() is set in the correct places, does anyone know of anything that I might be missing?

On the index.php page I have this:

session_start();print_r($_SESSION);// outputs nothing :'(

The code is pretty complex so will not post it all, just snippets.


Viewing all articles
Browse latest Browse all 707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>