On Mon, Jun 8, 2015 at 3:42 PM, akshat <akshatwillro...@gmail.com> wrote: > But this requires two separate views right? How does facebook know on the > first attempt that cookie support is not enabled in my browser?
It doesn't, it sets a cookie and redirects you to another URL to see if the cookie is present. You can see this if you inspect the web traffic to/from your browser using any one of a number of tools, eg chrome inspector. "A view" and "a webpage displayed to a user" are not necessarily the same thing, a view can simply be a piece of code that does something and redirects the user without displaying a webpage to the user. Typically, you would not implement this as one view, let alone two - you would use middleware to set the cookie and redirect, the same middleware then intercepts the next request and, if they have cookie support, allow them to access the requested resource, or display a page indicating that they need cookie support if they do not. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1%2B3FCSSo6cJY7JE%2Bd5cLpJr12-PKZXyTdGaoo0r0p%3D_CQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.