Socket
Book a DemoInstallSign in
Socket

browser-session

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-session

1.0.5
latest
Source
npmnpm
Version published
Weekly downloads
16
300%
Maintainers
1
Weekly downloads
 
Created
Source

browser-session

browser-session is Web Storage with the life cycle of the browser. Browser-session expires when any tab or window using it is all closed. Implemented internally using Local Storage and Session Storage.

Example

const storage = new BrowserSession({
    timeout: 100,
    namespace: 'namespace_name.'
  });
await storage.start(window);

storage.setItem('key', 'value');
storage.getItem('key');

Architecture

  • Session Storage stores encryption keys.
  • Local Storage stores encrypted values.
  • When start a new BrowserSession, it communicates with the currently open page(s) to obtain an encryption key.
  • If there is no open page and timeout occurs, a new encryption key is generated and stored in Session Storage.
  • The encryption key is kept even if you refresh within the same tab or change pages because session storage is used.

Contributors

  • hayan@yeonyu.dev : He gave the basic idea.
  • joseph@jc-lab.net : Implemented security through encryption.

License

Apache 2.0 License

FAQs

Package last updated on 11 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.