Back to Website Development
Website Development

PHP session variables losing data across pages

Posted on February 1, 2026, 9:25 am • 288 Views
I set $_SESSION['user'] on the login page, but when I redirect to the dashboard, the array is completely empty.
Did you call `session_start();` at the very absolute top of your dashboard.php file? It must be called on every single page before accessing the $_SESSION array.

You must be logged in to reply to this topic.

Login Register