Created
September 19, 2019 18:30
-
-
Save parzibyte/36a2fa86c4cfa8815bb09e82980271cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function gc($tiempo_de_vida) | |
{ | |
#Calculamos el tiempo actual menos el tiempo de vida. | |
$caducidad = time() - $tiempo_de_vida; | |
$sentencia = $this->base_de_datos->prepare("DELETE FROM sesiones WHERE ultimo_acceso < ?;"); | |
return $sentencia->execute([$caducidad]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment