I've done tons of redirects using PHP's header function. This one has stumped me.
On my dashboard controller, I check whether or not the $_SESSION['loggedin'] is set. If it's not set, I want to send the user back to the main page. However, I keep getting the "too many redirects" error, even though I only have it set once. Can anyone help me out? Thanks for the help in advance!
Here's my code -
function index() {
if(!isset($_SESSION['loggedin'])) {
header("Location: ./");
} else {
die("The user is logged in.");
}
}