Whenever we want an application to be accessed by registered users, we have to implement a mechanism that asks for the user's credentials before allowing them to view any web pages, which we will be covering in this recipe.
Implementing login and logout in web application
Getting ready...
As we have already created an HTML form in one of our previous recipes, we will just update it to implement login and logout mechanisms using the gorilla/securecookie package.
See the Implementing login and logout in web application recipe in Chapter 2, Working with Templates, Static Files, and HTML Forms.