PHP session does not work

4

I have a system that I use to validate the session. For validation use the code below:

<?php
session_start();
 public function validaUsuarios($loginUsuario,$senhaUsuario){
       .......
       $_SESSION['logado'] = true;
        header('location: entrar.php');
......
?>

And on the enter.php page:

<?php
session_start();
if($_SESSION['logado'] == false || $_SESSION['logado'] == ''){
    header('location: index.php');
}else{
 ...........

What I do not understand is that on other servers it worked perfectly, but on that server it does not catch up at first, that is, when giving a print, nothing happens in the session.

    
asked by anonymous 24.04.2015 / 14:28

1 answer

1

Make sure you have permission to write to the tmp folder, or to another folder in which php is configured to save session files;

In any case, check the server's php.ini settings and try to force settings using ini_set. The possible session settings you can find at link .

    
27.04.2015 / 19:52