<?php
if($_SESSION['IS_LOGEDIN'] == 'Y')
{
header("location:index.php?page=home");
exit();
}
?>
I have problem guys, i have this login code and this error when I wanna go in that page.
A session had already been started - ignoring session_start().
I tried to make the code in this way but when I want to go on the page, doesn't want to load:
<?php
if(!isset($_SESSION['IS_LOGEDIN']) == 'Y')
{
session_start();
header("location:index.php?page=home");
exit();
}
?>
What's the solution?
session_start();inside an included/required file, then that could cause it. You should putsession_start();at the top though. Plus thisif(!isset($_SESSION['IS_LOGEDIN']) == 'Y')you should be using 2 conditionals, not one. Check if not set,&&if equals to. - Funk Forty Niner