Akshay's Blog

Local Storage vs Cookies: Where to securely store data on the client-side?

Jun 07, 2022

Where to store data on the client-side? Cookies or local storage? Which one is better for caching, and which one is persistent? Which is more secure and which one is vulnerable to XSS and CSRF attacks? Where to store your JWT access tokens? Find out in this article!

Continue Reading

XSS attacks for beginners and how to defend against them

Jun 03, 2022

Cross-site scripting (XSS) attacks are a type of injection attack in which a malicious script may be injected into the document and executed. XSS is serious and can lead to account impersonation, observing user behaviour, loading external content, stealing sensitive data, and more.

Continue Reading

Why just using async-await and Promises doesn’t make your code asynchronous

Aug 11, 2022

Many developers are under the misconception that if they add “async” before their function definition, return a promise and use a “.then” or “await” on that promise, their code will be non-blocking (asynchronous). While awaiting the resolution of that promise, other code, such as handling UI interaction events is free to run. This article busts this myth with a few examples and tells you when your code is truly asynchronous and non-blocking.

Continue Reading

How JavaScript implements non-blocking I/O using async-await, callbacks and the event loop

Sep 01, 2022

This article discusses how JavaScript does not block a thread while waiting for an I/O event to happen. This is a continuation of my previous article: Why just using async-await and Promises doesn’t make your code asynchronous (JavaScript) which explains what thread blocking is and its different types.

Continue Reading