In order to test if the browser has cookie support, do we have to
place this cookie test on every function? Is this the general
practice? I mean what happens if a person has cookie support turned on
and while browsing he/she turns it off?

Also, If we use a set_test_cookie on the GET request and a
test_cookie_worked on the POST request, if the user hits the 'BACK'
button on POST page, the browser picks the page from it's cache,
thereby not executing the  set_test_cookie function. So when the user
POST a second time, if will throw an error that the test_cookie_worked
failed. e.g

if request.method == 'GET':
        request.session.set_test_cookie()
        return render_to_response('register.html',
RequestContext(request, {}))

elif request.method == 'POST':

        if request.session.test_cookie_worked():
           request.session.delete_test_cookie()
        else:
           return render_to_response('register.html',
RequestContext(request, {'cookie_error':'We have detected that your
browser does not support cookies. This site requires cookies for
proper functioning. '}))

       ....




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to