Error logging in administrative panel - Session_start [duplicate]

0

Hi everyone, I'm having a Session start error where the same guy who is not logged in is able to access the panel

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/emanoelgomes/public_html/eba/paineldecontrole/includes/header.php:1) in /home/emanoelgomes/public_html/eba/paineldecontrole/includes/header.php on line 1

index.php

session_start(); 

@$Usuario = $_SESSION["Usuario"];
@$Senha   = $_SESSION["Senha"];

if (isset($Usuario) && isset($Senha)){

    header("Location: inicial.php");    
}

acaologin.php

require_once    '../includes/configuration.php';

$userName = $_POST["user-name"];
$userPass = $_POST["user-pass"];
$criptSen = hash("whirlpool", $userPass);
@$rediURL = $_GET["url"];

$SQL = mysql_query("SELECT Usuario, Senha FROM administradores WHERE Usuario='$userName' AND Senha='$criptSen' ");

if(mysql_num_rows($SQL) != 0){

    session_start();

    $_SESSION['Usuario'] = $userName;
    $_SESSION['Senha']   = $criptSen;

    if(isset($rediURL)){

      header("Location: ../$rediURL");

    } else {

         header("Location: ../inicial.php");

    }

} else {

    header("Location: ../index.php");

}

In the case when the user logs in to index.php it will be redirected to loginacao.php, if everything is ok it goes to the initial.php, however, even without login if I access the initial.php it already ja Come in, what can it be?

    
asked by anonymous 20.03.2017 / 22:02

0 answers