Message: session_start(): Cannot send session cache limiter - headers already sent : <p>Having a problem with sessions which is becoming very annoying. Every time I try to start a session on a particular page I get the following error:</p>

<p>Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/uplbcdcn/public_html/CDC/admin_uplbcdc/header.php:57) in /home/uplbcdcn/public_html/CDC/admin_uplbcdc/index.php on line 33</p>

<p>Warning: Cannot modify header information - headers already sent by (output started at /home/uplbcdcn/public_html/CDC/admin_uplbcdc/header.php:57) in /home/uplbcdcn/public_html/CDC/admin_uplbcdc/index.php on line 42</p>

<p>Here is the Code: header.php</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
        &lt;title&gt;UPLB Credit and Development Cooperative&lt;/title&gt;
        &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;!-- Bootstrap --&gt;
            &lt;link href="../css/bootstrap.css" rel="stylesheet" media="screen"&gt;
            &lt;link href="../css/bootstrap-responsive.css" rel="stylesheet" media="screen"&gt;
            &lt;link href="../css/docs.css" rel="stylesheet" media="screen"&gt;
            &lt;link href="../css/diapo.css" rel="stylesheet" media="screen"&gt;
            &lt;link href="../css/font-awesome.css" rel="stylesheet" media="screen"&gt;
            &lt;link rel="stylesheet" type="text/css" href="../css/style.css" /&gt;
            &lt;link rel="stylesheet" type="text/css" href="../css/DT_bootstrap.css" /&gt;
            &lt;link rel="stylesheet" type="text/css" media="print" href="../css/print.css" /&gt;

    &lt;!-- js --&gt;         
    &lt;script src="../js/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
    &lt;script src="../js/bootstrap.js"&gt;&lt;/script&gt;
     &lt;script src="../js/jquery.hoverdir.js"&gt;&lt;/script&gt;

&lt;script&gt;
jQuery(document).ready(function() {
$(function(){
    $('.pix_diapo').diapo();
});
});
&lt;/script&gt;   
    &lt;noscript&gt;
            &lt;style&gt;
                .da-thumbs li a div {
                    top: 0px;
                    left: -100%;
                    -webkit-transition: all 0.3s ease;
                    -moz-transition: all 0.3s ease-in-out;
                    -o-transition: all 0.3s ease-in-out;
                    -ms-transition: all 0.3s ease-in-out;
                    transition: all 0.3s ease-in-out;
                }
                .da-thumbs li a:hover div{
                    left: 0px;
                }
            &lt;/style&gt;
        &lt;/noscript&gt;     

     &lt;script type="text/javascript" charset="utf-8" language="javascript" src="../js/jquery.dataTables.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" charset="utf-8" language="javascript" src="../js/DT_bootstrap.js"&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='../scripts/jquery.easing.1.3.js'&gt;&lt;/script&gt; 
&lt;script type='text/javascript' src='../scripts/jquery.hoverIntent.minified.js'&gt;&lt;/script&gt; 
&lt;script type='text/javascript' src='../scripts/diapo.js'&gt;&lt;/script&gt; 


&lt;!--sa calendar--&gt;  
        &lt;script type="text/javascript" src="../js/datepicker.js"&gt;&lt;/script&gt;
        &lt;link href="../css/datepicker.css" rel="stylesheet" type="text/css" /&gt;

&lt;/head&gt;
&lt;?php include('dbcon.php'); ?&gt;
&lt;body&gt;


index.php

&lt;?php include('header.php'); ?&gt;
&lt;?php include('navbar.php'); ?&gt;
    &lt;div class="container"&gt;
        &lt;div class="margin-top"&gt;
            &lt;div class="row"&gt;   
            &lt;div class="span12"&gt;

                &lt;div class="login"&gt;
                &lt;div class="log_txt"&gt;
                &lt;p&gt;&lt;strong&gt;Please Enter the Details Below..&lt;/strong&gt;&lt;/p&gt;
                &lt;/div&gt;
                        &lt;form class="form-horizontal" method="POST"&gt;
                                &lt;div class="control-group"&gt;
                                    &lt;label class="control-label" for="inputEmail"&gt;Username&lt;/label&gt;
                                    &lt;div class="controls"&gt;
                                    &lt;input type="text" name="username" id="username" placeholder="Username" required&gt;
                                    &lt;/div&gt;
                                &lt;/div&gt;
                                &lt;div class="control-group"&gt;
                                    &lt;label class="control-label" for="inputPassword"&gt;Password&lt;/label&gt;
                                    &lt;div class="controls"&gt;
                                    &lt;input type="password" name="password" id="password" placeholder="Password" required&gt;
                                &lt;/div&gt;
                                &lt;/div&gt;
                                &lt;div class="control-group"&gt;
                                    &lt;div class="controls"&gt;
                                    &lt;button id="login" name="submit" type="submit" class="btn"&gt;&lt;i class="icon-signin icon-large"&gt;&lt;/i&gt;&amp;nbsp;Submit&lt;/button&gt;
                                &lt;/div&gt;
                                &lt;/div&gt;

                                &lt;?php
                                if (isset($_POST['submit'])){
                                session_start();
                                $username = $_POST['username'];
                                $password = $_POST['password'];
                                mysqli_select_db($dbcon,$database_dbcon);
                                $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
                                $result = mysqli_query($dbcon,$query)or die(mysqli_error());
                                $num_row = mysqli_num_rows($result);
                                    $row=mysqli_fetch_array($result);
                                    if( $num_row &gt; 0 ) {
                                        header('location:dashboard.php');
                                $_SESSION['id']=$row['user_id'];
                                    }
                                    else{ ?&gt;
                                &lt;div class="alert alert-danger"&gt;Access Denied&lt;/div&gt;     
                                &lt;?php
                                }}
                                ?&gt;
                        &lt;/form&gt;

                &lt;/div&gt;
            &lt;/div&gt;      
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;?php include('footer.php') ?&gt;
</code></pre>
