def auto_auth_js(request):
    if 'sessionid' in request.COOKIES and request.user.is_authenticated():
        return render_to_response('administration/authentication/log.js',
                                  {'cookie': request.COOKIES['sessionid']},
                                  context_instance=RequestContext(request))
    else:
        return HttpResponseForbidden("<h1>Access Forbidden - Please log-in</h1>")
If there is a sessionid cookie, set it on, if not 404 error
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/authentication/views.py/auto_auth_js