def client_common(request, group):
    if request.method != 'POST':
        return NeverCacheRedirectView.as_view(url="/")(request)

    response = http.HttpResponse(content_type='application/javascript')

    if not CONFIG.valid(group):
        response.write(json.dumps({
            'code': error.ERROR_GROUP,
            'error': 'Unknown group',
            'next': -1,
            }))
        return (response, None, None)

    # Check the cookie value exists
    if 'user' not in request.COOKIES:
        response.set_cookie('user', value=user_key(request))
        response.write(json.dumps({
            'code': error.WARNING_COOKIE,
            'error': 'No cookie set',
            'next': 0,
            }))
        return (response, None, None)

    # Check the cookie value is valid
    salt, digest = request.COOKIES['user'].split(':')
    if user_key(request, salt) != request.COOKIES['user']:
        response.delete_cookie('user')
        response.write(json.dumps({
            'code': error.WARNING_COOKIE,
            'error': 'Cookie was invalid?',
            'next': 0,
            }))
        return (response, None, None)

    return (None, group, request.COOKIES['user'])
Check the common information for an client request.
dataset/ETHPy150Open timvideos/streaming-system/website/tracker/views.py/client_common