<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _is_loggedin(self, auth_secret):
 """Check if a user is logged-in by verifying the input authentication secret. Parameters auth_secret: str The authentication secret of a logged-in user. Returns ------- bool True if the authentication secret is valid, False otherwise. userid: str The user ID associated with the authentication secret if the authentication secret valid, None otherwise. """

        # Get the userid from the authentication secret.
        userid = self._rc.hget(pytwis_constants.AUTHS_KEY, auth_secret)
        if userid is None:
            return (False, None)

        # Compare the input authentication secret with the stored one.
        userid_profile_key = pytwis_constants.USER_PROFILE_KEY_FORMAT.format(userid)
        stored_auth_secret = self._rc.hget(userid_profile_key, pytwis_constants.AUTH_KEY)
        if auth_secret == stored_auth_secret:
            return (True, userid)

        # TODO: Resolve the inconsistency of the two authentication secrets.
        return (False, None)