'If request.anonymous was modified set the anonymous cookie.'

def process_response(self, request, response):

    try:
        modified = request.anonymous.modified
    except AttributeError:
        pass
    else:
        if modified:
            max_age = settings.ANONYMOUS_COOKIE_MAX_AGE
            expires_time = (time.time() + max_age)
            expires = cookie_date(expires_time)
            response.set_cookie(settings.ANONYMOUS_COOKIE_NAME, request.anonymous.anonymous_id, max_age=max_age, expires=expires)
    return response
