def get_or_create_session_key(self):
    '\n        Get or create the session key from the request object.\n\n        When not present yet, this initializes the session for the user.\n        As a result, the request then returns session cookie to the user\n        via session middleware.\n        '
    session_key = self.request.session.session_key
    if (session_key is None):
        self.request.session.create()
        session_key = self.request.session.session_key
    return session_key
Get or create the session key from the request object.

When not present yet, this initializes the session for the user.
As a result, the request then returns session cookie to the user
via session middleware.
def get_or_create_session_key(self):
    '\n        Get or create the session key from the request object.\n\n        When not present yet, this initializes the session for the user.\n        As a result, the request then returns session cookie to the user\n        via session middleware.\n        '
    session_key = self.request.session.session_key
    if (session_key is None):
        self.request.session.create()
        session_key = self.request.session.session_key
    return session_key