Problems with $ _SESSION

1

I have a problem to solve. I have the same site on several different servers, but one has a different result. It looks like it has some error, I do not know if it is setup.

Here is the following test code I did:

session_start();  
if(!isset($_SESSION["funcio"]) || !isset($_SESSION["senha"])){  
require_once "sair.php";  
}  
print $_SESSION["funcio"];  
$_POST['funcio'] = '1';    
$funcio = '2';  
print $funcio;  
print $_POST['funcio'];  
print $_SESSION["funcio"];  

Results:
On sites that work normally the result is

  

Admsite 2 1 Admsite

On the problem site, the result is

  

Adm 2 1 2

Conclusion: By declaring the variable $ function with the same name as $_SESSION["funcio"] and setting its value, the variable $_SESSION["funcio"] assumes the value of the variable $funcio . This is giving me a major inconvenience. Please help me to resolve this issue. I've already looked at php.ini and both servers are pretty much the same. Hugs

I have already checked, $ _SESSION ["funcio"] values are correct, but on that server, when I create a $ function variable and set its value, the variable $ _SESSION ["function"] assumes the value of the created variable.

I noticed that this occurs not only with this variable, but with all variables of type $ _SESSION whose name is the same as the variables that I create.

What will this be?

    
asked by anonymous 03.08.2017 / 08:00

0 answers