I put together a login script however I'm getting this warning message once i'm redirected to 'logged in' area of website. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/..../axiom/myaccount.php:7) in /home/..../axiom/myaccount.php on line 8 What is causing this? I'm sure it's just something simple that I'm missing. This is the code that contains line 8 <?php session_start(); if (!isset($_SESSION['user'])) { die ("Access Denied"); } ?> PHP:
There is data being sent to the browser before you do the session_start. The session_start has to be set before you send anything to the browser. Its the same for using the header() function.
make sure theres no content or even space before this code <?php session_start(); if (!isset($_SESSION['user'])) { die ("Access Denied"); } ?>