Posts

Lets Generate a free SSL certificate and run an HTTPS server in 5 minutes or less (Node + Express + LetsEncrypt)

Image
  What you actually came for First , you need those few things: A server running on a linux distribution with root access (via SSH) NodeJS:  https://nodejs.org/en/ Express :  npm install express Certbot To install certbot, copy-paste those lines in a terminal : $  sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot Second , you will generate an SSL certificate with certbot : $ certbot certonly --manual Type your domain name(s) without the protocol part. For instance:  yourdomain.com  or even  muchdomain.verysite. Type  Y  then  ENTER. Note two things : a-string :  The name of the file you have to create, right now. Just create it, we’ll take care of the directories later. a-challenge:  Open the file you just created and put this challenge string into it. Nothing else, just this challenge string. Now, don’t continue. You need to run a web server with Node & Express. Keep your term...

How to Secure Session Management in Node

In a web application, data is transferred from a browser to a server over HTTP. In modern applications, we use the HTTPS protocol, which is HTTP over TLS/SSL (secure connection), to transfer data securely. Looking at common use cases, we often encounter situations where we need to retain user state and information. However, HTTP is a stateless protocol. Sessions are used to store user information between HTTP requests. We can use sessions to store users' settings like when not authenticated. Post authentication sessions are used to identify authenticated users. Sessions fulfill an important role between user authentication and authorization. Exploring Sessions Traditionally, sessions are identifiers sent from the server and stored on the client-side. On the next request, the client sends the session token to the server. Using the identifier, the server can associate a request with a user. Session identifiers can be stored in cookies, localStorage, and sessionStorage. Session identi...

Popular posts from this blog

How to download a file using command prompt (cmd) Windows?

How to Secure Session Management in Node

How to Include ThreeJs in Your Projects