A Brief History of Web Authentication (part 2)

A Brief History of Web Authentication (part 2)

node.js guide to web authentication. So in the previous article, we discussed authentication procedures like encryption, hashing, salting, etc. Now that we have verified the user let's ...

So in the previous article, we discussed authentication procedures like encryption, hashing, salting, etc. Now that we have verified the user let’s concentrate on the session.

So what is this _session _and _cookie _thing?

Image for post

Photo by Mae Mu on Unsplash

A story about Https

_Https _is basically a stateless protocol. What does it mean by _stateless _🤔? Basically, whenever we open chrome and search for something or hit an endpoint, a secure connection is established between the _server _and you (client). The _server _accepts your request, it does _authentication _in case you provided _id _and _password _and sends you back the information you asked. After that, the connection is closed. Next time you ask the server again, but the _server _doesn’t know who you are. If the information you are asking requires authentication, you have to put _id _and _password, _again and again, each time you query something.

One thing to remember that we should not use __Http __because it is not end-to-end encrypted, so anybody can tap into the channel, have a look in the data inside it, and ah-ha! You are hacked!

Suppose you are accessing a bank website. How does it feel like to put id, password, and secure CAPTCHA each time you press a button or page refreshes? Frustrating na?

Image for post

Stateless Https connection

That is where _sessions _and _cookies _come into the picture.

Let’s understand in simple terms. Before understanding the _session _and cookie, let's look at the Https messages.

There are two types of http messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.

But broadly they have a similar structure with

  1. Head — It has information like request verb (GET/POST/PUT… in case of request), status code (in case of response), target URL, body content metadata, etc.
  2. Body — Body is optional. It can have HTML form etc.

nodejs cookies sessions expressjs webauth

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire NodeJs Developer

Looking to build dynamic, extensively featured, and full-fledged web applications? **[Hire NodeJs Developer](https://hourlydeveloper.io/hire-dedicated-node-js-developer/ "Hire NodeJs Developer")** to create a real-time, faster, and scalable...

Hire Nodejs Developer

Looking to **hire NodeJS Developer**[https://www.dataeximit.com/node-js-development/](https://www.dataeximit.com/node-js-development/ "https://www.dataeximit.com/node-js-development/") to build a perfect back-end to your website or...

Decoding Nodejs

The main goal of this blog is to explain the “Architecture of Nodejs” and to know how the Nodejs works behind the scenes. Generally, most of the server-side languages, like PHP, ASP.NET, Ruby, and including Nodejs follows multi-threaded architecture. That means for each client-side request initiates a new thread or even a new process.

What is difference between NodeJS and ExpressJS?

The difference between node.js and express.js in the level of abstraction: Node.js is a platform for building server-side event-driven i/o application using javascript. Express.js is a framework based on node.js for building web-application using principles and approaches of node.js. In this post, we'll discuss What is difference between NodeJS and ExpressJS?

How to Install NodeJS on Ubuntu 19.04

In this tutorial, you will learn how to install Node onto Ubuntu 19.04 Disco Dingo. We will cover installation from the default repositories and, for those wanting more recent releases, how to install from the NodeSource repositories.