Tiny Frontend Logo
Posts 0112

On This Page

JavaScript: Session Storage

As a frontend developer, understanding how to store data on the client side is crucial. In this article, we’ll delve into the world of web storage, specifically focusing on session storage. Let’s explore what it is, how it works, and when to use it.

What is Session Storage?

Session storage is one of the two main types of web storage available in modern browsers (the other being local storage). It allows you to store data in key-value pairs directly within the user’s browser. Session storage data remains local and is accessible only during the current browser session.

Key Characteristics

Scope

Data stored in session storage is limited to the current tab or window. If the user opens a new tab or window, a separate session storage instance is created.

Lifetime

Session storage persists only for the duration of the browser session. When the user closes the tab or window, the data is automatically cleared.

Storage Limit

Session storage typically allows around 5MB of data per app. This capacity is sufficient for most use cases within a single session.

Subscribe to read the full content

* Free subscribe to enjoy full content access.
* You can cancel anytime with 1-click.

Read Next

0110

Cross-Origin Resource Sharing (CORS)

Please imagine you're building a spiffy weather application using JavaScript and you want to display live weather data from a popular weather service.

Cross-Origin Resource Sharing (CORS)
0109

Cross-Site Scripting (XSS) in JavaScript

Cross-Site Scripting (XSS) is a web security vulnerability that allows an attacker to inject malicious code into a web page that is viewed by other users.

Cross-Site Scripting (XSS) in JavaScript
0108

Multiple Promises Handling in JavaScript

Promises are a powerful way to handle asynchronous operations in JavaScript. They allow us to write clean and readable code, without using callbacks or nested functions.

Multiple Promises Handling in JavaScript
0107

Promises for Asynchronous JavaScript

In this guide, we'll delve into the ins and outs of promises, covering their syntax, usage, common patterns, and best practices.

0106

Styling the First Letter

The ::first-letter pseudo-element applies styles to the first letter of a block container.

Styling the First Letter
0105

The Deprecation of Third-Party Cookies

Google has announced its plan to disable third-party cookies by default in Chrome, a step that will reshape the landscape of online tracking and user privacy. This change is part of a broader effort to enhance user privacy and security on the web.

The Deprecation of Third-Party Cookies