I am getting an error related to session_start() on page load.
Warning: session_start(): Cannot send session cache limiter - headers already sent
I understabd from the previous posts that we are supposed to put it right at the beginning of the page even before all HTML. So I changed my code to this:
<?php
if(session_id()=='')
{
session_start();
}
if (!isset($_SESSION['can_access']) || ($_SESSION['can_access'] != TRUE))
{
echo "Access denied";
exit();
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge chrome=1" />
</head>
<body>
But I still get this error. Could anyone suggest what could be done?