'Gets and encrypts the Django session key from the request or an empty string if it isn\'t found.'

def get_session_key(self, request):

    try:
        return self.encrypt_session_key(request.session.session_key)
    except AttributeError:
        return ''
