Question Everything!
New member
Note: Every time file is ran then timestamp in database is set to time().
lets say i have a sql database where user is stored with username, password, timestamp. What is a code that checks if the timestamp in the database is 15 minutes old and if so on refresh or if user goes to new page calls logout()?
Its just confusing doing the timestamps with seconds, So,
$timeout = time() - 900;
if ($sqlResult['timestamp'] > $timeout) {
logout();
}
is the correct?
CHECK:
After checking your/my code it must be
if ($timestamp < time() - 900) {
logout();
}
NOT $timestamp > time() - 900
Am i correct?
lets say i have a sql database where user is stored with username, password, timestamp. What is a code that checks if the timestamp in the database is 15 minutes old and if so on refresh or if user goes to new page calls logout()?
Its just confusing doing the timestamps with seconds, So,
$timeout = time() - 900;
if ($sqlResult['timestamp'] > $timeout) {
logout();
}
is the correct?
CHECK:
After checking your/my code it must be
if ($timestamp < time() - 900) {
logout();
}
NOT $timestamp > time() - 900
Am i correct?