O'Reilly logo

Go Web Development Cookbook by Arpit Aggarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works…

Once we run the program, the HTTP server will start listening locally on port 8080.

Next, browsing http://localhost:8080 will show us the login form, as shown in the following screenshot:

Submitting the form after entering the username Foo and a random password will render the Welcome Foo! message in the browser and create a cookie with the name session, which manages the user login/logout state:

Now, every subsequent request to http://localhost:8080/home will display the Welcome Foo! message in the browser until the cookie with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required