Basically what I wanted was to create a session with an expire time of 24 hours. And I wrote this:
session_start();
if (!isset($_SESSION['TIME_START']) || $_SESSION['TIME_START'] < time()) {
$_SESSION['TIME_START'] = time();
} else if ($_SESSION['TIME_START'] > 60 * 60 * 24) {
session_destroy();
}
I would like to know if this is a valid, viable or good practice to do it. Thanks!