def get_user_by_session(self, save_session=True):
    'Returns a user based on the current session.\n\n        :param save_session:\n            If True, saves the user in the session if authentication succeeds.\n        :returns:\n            A user dict or None.\n        '
    if (self._user is None):
        data = self.get_session_data(pop=True)
        if (not data):
            self._user = _anon
        else:
            self._user = self.get_user_by_token(user_id=data['user_id'], token=data['token'], token_ts=data['token_ts'], cache=data, cache_ts=data['cache_ts'], remember=data['remember'], save_session=save_session)
    return self._user_or_none()
Returns a user based on the current session.

:param save_session:
    If True, saves the user in the session if authentication succeeds.
:returns:
    A user dict or None.
def get_user_by_session(self, save_session=True):
    'Returns a user based on the current session.\n\n        :param save_session:\n            If True, saves the user in the session if authentication succeeds.\n        :returns:\n            A user dict or None.\n        '
    if (self._user is None):
        data = self.get_session_data(pop=True)
        if (not data):
            self._user = _anon
        else:
            self._user = self.get_user_by_token(user_id=data['user_id'], token=data['token'], token_ts=data['token_ts'], cache=data, cache_ts=data['cache_ts'], remember=data['remember'], save_session=save_session)
    return self._user_or_none()