Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 10. Sessions and Cookies

In the last chapter, we conquered database transactions. We extended our hipstr application to use them, and it worked, and it was good. If you've been paying attention (and I'm sure you have because it's Chapter 10 and we're almost done), you'll have noticed that we've yet to actually authenticate our user, create a session, or write any cookies. Well, I've got news for you: In this chapter, we're going to do all three of those things! That is, we're going to cover the following topics in this chapter:

  • Learn about sessions and how they're maintained in Luminus and Noir

  • Build a form to authenticate our user

  • Create a cookie that remembers the username for the next time a user wants to login

We'll start off with a bit of how these things are accomplished in Luminus (and the underlying lib-noir library), and then extend our hipstr application to embrace these missing components.