O
O
OxygenMan2020-05-27 22:14:13
PHP
OxygenMan, 2020-05-27 22:14:13

Variables in SESSION are not updated. What to do?

Hello! At me after authorization session transfers variables on a trace. page, but when the database changes, the variables remain the same until I re-login to the account. Why are variables not updated?

This code works like this - I go into the account, displays the login. When I change in the database and reload, it does not display anything, var_dump shows NULL. And the variable takes on a new value only after logout and authorization.

<?php
session_start();

require_once 'connect.php'; 
?>
<?php 
if (isset($_SESSION['signined'])) 
{
  $user_login =  R::getAll("SELECT login FROM users WHERE login = '".unserialize($_SESSION['signined'])->login."'");
  $login = $user_login[0]['login'];
  echo $login;
  var_dump($login);
} 
else
{
  $_SESSION['message'] = 'Для доступа к этой странице необходимо авторизоваться';
  header('Location: ../login.php');
}
 ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-05-27
@galaxy

Why are you creating duplicates?
And show all the code, all files, including the includes. What for these pieces which you also change constantly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question