Javascript is a single threaded language, which essentially means that it has no native support for performing multiple tasks simultaneously. This poses a problem because on UI it is crucial to have an async behaviour. Javascript solves this problem using the event loop. In order to adapt to this async behaviour the simplest option we can opt for are callbacks which have their own issues. Another option available to us is Promises

As per MDN web docs, Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value. A promise can be in three states…


Photo by Olia Gozha on Unsplash

As we all know, our session information is stored in the cookies 🍪 . Let’s begin by taking a look at what cookies are stored by facebook. For manipulating cookies i’ll be using EditThisCookie chrome extension, make sure you enable the extension in incognito mode as well.

Open up facebook in incognito window and take a look at the cookies using EditThisCookie. Since we are initially logged out, none of these cookies correspond to session specific data. …

Jasmeet Singh

Software engineer, Web enthusiast, Gamer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store