开发者

Django IE8 session fail (literally makes zero sense)

I am having an issue that I just can't figure out at all. It's two parts.

I have a splash page which requires users to enter a Beta code. If the code is valid, they are redirected to a registration page. If they register correctly, they are authenticated in Django and are redirected to the site's homepage. All the pages in the site, save for splash and register, have @login_required decorators.

Now bizarrely, some of my test users are claiming that they get signed in and then redirected to splash page randomly. I can't reproduce that and several of my other testers also can't reproduce that error. I don't understand it at all.

Even more strange, though, is the fact that I can't successfully authenticate the user at all in IE8. It just keeps redirecting me back to splash page in IE8, even though the same code is working for me on other browsers. But wait, there's more, I tested it on a friend's computer today and IE8 worked on their computer.

What the hell, I'm so frustrated. Some basic thoughts on where I can start with this?

EDIT:

Here is my splash page view:

def splash(request):

  error=''
  #request.session.set_test_cookie()

  if request.method=="POST": 
    #if request.session.test_cookie_worked():
    #   request.session.delete_test_cookie()
    #else:
    #   cookie_error="You must enable cookies in your browser to use our login system. Our cookies will not track your behavior outside this site or do anything else malicious"
    #   return render_to_response("website/splash.html", {'cookie_error':cookie_error}, context_instance=RequestContext(request))   

    if request.POST.get('email_list',''):
        beta_testform=Beta_TestForm(request.POST)
        if beta_testform.is_valid():
            beta=beta_testform.save()
            return HttpResponseRedirect('/splash/?mls=True')
        else:   
            email_error="Please enter a valid email address"
            return render_to_response("website/splash.html", {'email_error':email_error},context_instance=RequestContext(request))
    if request.POST.get('code'):
        hardcode='codehere'
        code=request.POST.get('code','')
        if hardcode==code:
            request.session['beta']=True
            return HttpResponseRedirect('/splash/register/')
            return HttpResponseRedirect('/')
        else:
            beta_error='Please ente开发者_StackOverflowr a valid Beta code'
            return render_to_response("website/splash.html", {'beta_error':beta_error}, context_instance=RequestContext(request))

Here is a link to another thread I started (which went unanswered). It contains my register page view

https://stackoverflow.com/questions/5758598/decorator-or-session-fail-bug-only-occurs-for-of-users

UPDATE... apparently this intermittent session breakages has been an issue for other people as well. Django session intermittently disappears just after login

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜