timeout = (int) $users['auto_logout_user_time'] ?? 1800; add_filter( 'auth_cookie_expiration', [ $this, 'auto_logout_user_cookie_expiration' ] ); } } /** * Adjusts the expiration time for a user's auto-logout cookie. * * @param mixed $length The initial length of the cookie expiration time. * @param int $user_id The ID of the user whose cookie expiration is being modified. * @param bool $remember A flag indicating if the "remember me" option is selected, which may impact the expiration time. * * @return int The modified timeout value for the cookie expiration. */ public function auto_logout_user_cookie_expiration( mixed $length, int $user_id, bool $remember ): int { return $this->timeout; } }