How to show that the user is logged in the pages that he visits?

-1

How do I get the user after login, that he can see in some corner of the screen his name with some information of him with that login and that when he presses the "back" or "exit" a question appears if he really wants to proceed, and if he confirms it to log out and return to the index.

    
asked by anonymous 02.11.2017 / 16:55

1 answer

1

use php session variables

session_start();
$_SESSION['nome_da_variavel'] = valor da variavel;

example:

session_start();
$_SESSION['nome'] = "joao";
echo $_SESSION['nome'];

obs: it is possible to use the variables declared per session on several pages, they are stored while the browser is open, which facilitates the login system.

and to exit, or go back, just use

session_destroy();

that ends / destroys all values of session variables

    
02.11.2017 / 17:10