Implement system remind me

1

I am doing a web application and I would like to know what is the best way to implement a "Remember Me" or "Remember my data" system.

In other words, I want the user to be able to mark a "Remember me" box when logging in, and I do not have to log into the team anymore.

    
asked by Peter Allen 04.09.2018 в 13:24
source

1 answer

0

You can use cookies:

setcookie("EstaLogeado", true); //Esta línea la pones en el php cuando el login tenga exito

//Si quieres que la cookie tenga tiempo de expiracion de 1 hora
setcookie("EstaLogeado", true, time()*3600);

//Para comprobar si la cookie está definida
if($_COOKIE["EstaLogeado"] == true) {
    //Carga la pagina normal porque ya está logeado
}
    
answered by 04.09.2018 в 13:29