Skip to content

Commit

Permalink
[FEATURE] Introduce wrapper for sessionStorage (#1108)
Browse files Browse the repository at this point in the history
See Core Feature 91738
See #1082
  • Loading branch information
susannemoog committed Nov 20, 2020
1 parent b5aa1be commit 2d324b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/ApiOverview/JavaScript/Modules/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ be used by extensions.
Modals
MultiStepWizard
DocumentService
SessionStorageWrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. include:: /Includes.rst.txt

.. _modules-sessionstorage:

======================
SessionStorage Wrapper
======================

TYPO3 ships a module acting as a wrapper for :js:`sessionStorage`. It
behaves similar to the :js:`localStorage`, except that the stored data is dropped
after the browser session has ended.

The module :js:`TYPO3/CMS/Core/Storage/BrowserSession` allows
to store data in the :js:`sessionStorage`.

API Methods
-----------

* `get(key)` To fetch the data behind the key.
* `set(key, value)` To set/override a key with any arbitrary content.
* `isset(key)` (bool) checks if the key is in use.
* `unset(key)` To remove a key from the storage.
* `clear()` to empty all data inside the storage.
* `unsetByPrefix(prefix)` to empty all data inside the storage with their keys
starting with a prefix

0 comments on commit 2d324b6

Please sign in to comment.