Example #1
0
    def store_in_session(self, session: SessionBase):
        """Set the payload in the current session.

        :param session: Session object
        """
        session[PAYLOAD_SESSION_DICTIONARY] = self.__store
        session.save()
Example #2
0
def _set_user_key(session: SessionBase, user_key: str) -> None:
    """
    Set the given user_key in the session.

    Note about test client session object lifetime:
    https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.Client.session
    """
    session[views.SESSION_USER_KEY_NAME] = user_key
    session.save()