src/session.php
private static function validate() {
	if (self::is_active() == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('inactive session');
	}
	
	if (empty($_SESSION['_session_type']) || empty($_SESSION['_session_last_active'])) {
		return false;
	}
	
	// throw away expired (replaced) sessions
	if (!empty($_SESSION['_session_expire_at']) && $_SESSION['_session_expire_at'] < time()) {
		return false;
	}
	
	// last_active short enough ago
	$type_duration = self::$type_durations[ $_SESSION['_session_type'] ];
	$active_enough = ($_SESSION['_session_last_active'] > (time() - $type_duration));
	if ($active_enough == false) {
		return false;
	}
	
	return true;
}
private static function validate() {
	if (self::is_active() == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('inactive session');
	}
	
	if (empty($_SESSION['_session_type']) || empty($_SESSION['_session_last_active'])) {
		return false;
	}
	
	// throw away expired (replaced) sessions
	if (!empty($_SESSION['_session_expire_at']) && $_SESSION['_session_expire_at'] < time()) {
		return false;
	}
	
	// last_active short enough ago
	$type_duration = self::$type_durations[ $_SESSION['_session_type'] ];
	$active_enough = ($_SESSION['_session_last_active'] > (time() - $type_duration));
	if ($active_enough == false) {
		return false;
	}
	
	return true;
}
private static function validate ( ) { if ( self :: is_active ( ) == false ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'inactive session' ) ; } if ( empty ( $ _SESSION [ '_session_type' ] ) || empty ( $ _SESSION [ '_session_last_active' ] ) ) { return false ; } // throw away expired (replaced) sessions if ( ! empty ( $ _SESSION [ '_session_expire_at' ] ) && $ _SESSION [ '_session_expire_at' ] < time ( ) ) { return false ; } // last_active short enough ago $ type_duration = self :: $ type_durations [ $ _SESSION [ '_session_type' ] ] ; $ active_enough = ( $ _SESSION [ '_session_last_active' ] > ( time ( ) - $ type_duration ) ) ; if ( $ active_enough == false ) { return false ; } return true ; }
checks whether the session is still valid to continue on
this mainly checks the duration, and delayed deletions

@return boolean
checks whether the session is still valid to continue on this mainly checks the duration and delayed deletions