Understanding server authentication
Back in the golden age of server-side languages such as PHP (https://php.net), the only thing JavaScript was used for was to add a little bit of interaction or animation to a website. Most user-based processes, including authentication, happened by submitting a form, and a new page request was made that processed it – there was no background request or asynchronous authentication. Plus, internet connections were slow and we wanted as few frontend assets as possible.
In the end, authentication itself always happens on a server (where the user credentials are checked against the database). However, nowadays, the frontend often calls the server in the background instead of doing a submit that causes a new page request.
However, I want to show you exactly how to do that. The question is: why would we want to go back to authentication, which means loading a new page, instead of doing it in the background with the help of the frontend?
...