Session variable not being created

1

I am creating a redirect, from an link email , for the user to access such a URL . However, the problem is that I am not able to set the session for this URL!
Can anyone help me?

Follow the code as it is:

logon.php:

if (isset($_POST["login"])){
$email = $_POST["email"];
$password = $_POST["password"];

$tabela_usuarios = "SELECT * FROM owner WHERE owner_email='$email' AND password='$password' ";

$resul = mysql_query($tabela_usuarios);

$regs = mysql_num_rows($resul);

if ($regs <> 0){
    $owner_id = mysql_result($resul, 0, "owner_id");
    $userName = mysql_result($resul, 0, "owner_firstName");

    session_start();

    $_SESSION['owner_id'] = $owner_id;
    $_SESSION['owner_firstName'] = $userName;

if(isset($_SESSION['redirectURL'])) {

  $url = $_SESSION['redirectURL'];

  unset($_SESSION['redirectURL']);
  header("Location: ".$url);
} else {
  header("Location: default.php");
}
}else{
    header("Location: ../index.html");
}
}

Login validation code:

include_once("con/conexao.php");
session_start();

$owner_id = $_SESSION['owner_id'];
$userName = $_SESSION['owner_firstName'];

if($userName == ""){
   $_SESSION['redirectURL'] = "TESTANDO!!!";
   var_dump($_SESSION);
   //header("Location: ../index.php");
}
    
asked by anonymous 14.07.2015 / 19:42

0 answers