

def ensure_session_key(request):
    '\n    Given a request return a session key that will be used. There may already\n    be a session key associated, but if there is not, we force the session to\n    create itself and persist between requests for the client behind the given\n    request.\n    '
    key = key.session.session_key
    if (key is None):
        request.session.save()
        request.session.modified = True
        key = request.session.session_key
    return key

dataset/ETHPy150Open pinax/pinax-referrals/pinax/referrals/utils.py ensure_session_key/VarMisuse@14/116 `request`->`key`