Simple Interface window.sessionStorage With jQuery | JQuery Session Plugin

The JQuery plugin provides a simple interface  window.sessionStorage while providing limited support for requests across protocols. session.js is a brilliant tiny sessionStorage manipulation plugin used to set, get, clear, and take away information saved in browser session storage.

Must Read: Form Prefill Based on URL Parameters, Cookies, or Session Store | jquery.formprefill

How to make use of it:

1. Load the primary script jquery.session.js after loading the most recent jQuery library.

<script src="/path/to/cdn/jquery.min.js"></script> <script src="/path/to/jquery.session.js"></script>

2. Save information to sessionStorage.

// $.session.set('key', 'value');
$.session.set('website', 'WCF');

3. Get saved information from sessionStorage.

// $.session.get('key');
$.session.get('website');
=> 'WCF'

4. The plugin additionally helps technique chaining as follows:

$.session.set('website', 'WCF').get('website');
=> 'WCF'

5. Remove saved information from sessionStorage.

// $.session.remove('key');
$.session.remove('website');

6. Clear all saved information from sessionStorage.

$.session.clear();

See Also –

Pull-based Cross-window Communication for Multi-window Angular Apps
Prevent Data Loss In The Form By Refreshing Page | oops.js
Onclick Toggle Show Hide Other Div jQuery | jq-collapse.js


See Demo And Download

Official Website(AlexChittock): Click Here

This superior jQuery/javascript plugin is developed by AlexChittock. For extra Advanced Usage, please go to the official website.

Related Posts

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

jquery-cookie-consent

Simple jQuery Cookie Consent Plugin

jquery.cookie-consent is a simple jQuery plugin to request consent to use cookies. An easy-to-use and highly customizable cookie consent bar that informs your visitors of the use…

Timepicker-Plugin-for-jQuery

Timepicker JavaScript Plugin for jQuery Inspired by Google Calendar

jquery.timepicker is a lightweight jQuery timer plugin inspired by Google Calendar. It supports both mouse and keyboard navigation and weighs 5.5KB minified and compact. Features: Highly customizable…

angular-ngx-carousel-slider

A Lightweight, Touchable, and Responsive Angular Universal Carousel Library

ngxCarousel is a lightweight, tactile, and responsive library for creating an angular carousel. No dependencies, no more hammer. Must Read: Angular Responsive Image Slider With Lightbox Popup…

random-number-picker

Generate a Random Number Picker In Vanilla JavaScript

Random Number Picker is a Vanilla JS-based number picker that allows you to generate a random number within a specified range. Must Read: Generating Lottery Numbers Using…

Nepali-Date-Picker-jQuery-Plugin

Nepali Date Picker jQuery Plugin | nepaliDatePicker

Nepali Date Picker is a customizable, easy-to-use, and input-based date picker plugin mostly based on the Nepali calendar. Users can choose a Nepali date in the navigable…