Handling logins
Handling logins can be tricky for a variety of reasons, and there are hundreds of different techniques out there. Web application login generally falls in one of two categories: either your site is free to browse without being logged in (anytime login), or it uses and requires the user to log in first (gated login). The challenges presented by each category are different, and so are the best solutions.
Gated login
Until fairly recently, almost all gated login sites used some redirection pattern to present a login page to users, which was usually an unpleasant experience. Beyond the issue of page load time, getting back to the originally requested URL generally meant query string parameters that contained the original URL. If the original URL had query strings itself, they were either lost or appended to the URL query value.
SPAs can sidestep the redirection problem by just showing a login page at the current URL; no redirection means the whole process is faster, there is no...