Chapter 6. Logging in and out

In Chapter 4, we implemented a rudimentary default user page, and we promised to restrict access to this page based on the user’s login status. This is the first of two chapters fulfilling that promise. In this chapter, we develop a basic login and authentication system, and in Chapter 7 we implement a more advanced system with cookie-based “remember me” functionality.

While it’s certainly possible to implement a simple login system using relatively little code, taking the time to build an industrial-strength authentication system is well worth the effort. After all, virtually every web application requires some sort of login machinery for its operation. Moreover, authentication offers a rich variety of problems ...

Get RailsSpace: Building a Social Networking Website with Ruby on Rails™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.