Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Creating a user login page

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:

  1. Users must be able to log in through some form.
  2. Users must get logged in, set something in the user's session, and redirect out somewhere.
  3. 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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content