On Mon, Jun 8, 2015 at 3:42 PM, akshat <
akshatw...@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