To create our user login experience, we'll need to start by creating a session controller that will be responsible for a few separate operations:
- Users must be able to log in through some form.
- Users must get logged in, set something in the user's session, and redirect out somewhere.
- Users must be able to log out.
The best way for us to accomplish this is to create a separate sessions resource, where create represents the posted login that sets the user session and redirects. We'll also want a way to log in and log out (although we'll want to handle those separately). We'll start out with a few simple basics. To start, we need to modify our routes to include these new methods, and we'll also probably want to create ...