{"result":{"depiction_url":null,"edges":{"subject":{"objects":[{"created":"2026-09-30T09:11:24Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":3},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2673,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_javascript","title":"JavaScript","uri":"https:\/\/zotonic.com\/id\/2673"},"seq":4},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2713,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_browser_storage","title":"Browser storage","uri":"https:\/\/zotonic.com\/id\/2713"},"seq":5},{"created":"2026-09-30T09:11:24Z","object_id":{"id":2718,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_cotonic","title":"Cotonic","uri":"https:\/\/zotonic.com\/id\/2718"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2742,"is_a":["text","documentation","reference","cotonic_reference","cotonic_model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2742"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_cotonic_model_sessionstorage","page_url":{"en":"https:\/\/zotonic.com\/cotonic\/models\/sessionstorage","x-default":"https:\/\/zotonic.com\/cotonic\/models\/sessionstorage"},"preview_url":null,"resource":{"version":15,"pivot_location_lat":null,"title":"model\/sessionStorage","is_authoritative":true,"body":"<a name=\"model.sessionStorage\"><\/a><h3>model.sessionStorage<\/h3>\n            <p>\n            The sessionStorage model provides access to the <tt>sessionStorage<\/tt> of\n            the browser. It makes it possible to set and retrieve values via\n            mqtt topics. For more information about the session storage see:\n            <\/p>\n\n            <a name=\"model.sessionStorage.get.key\"><\/a><h4>get\/+key<\/h4><p>\n            Get the element stored as <tt>key<\/tt> from the sessionStorage. Returns the\n            contents as payload, or <tt>null<\/tt> if it is not found.\n            <\/p>\n            <pre>\nself.call(&quot;model\/sessionStorage\/get\/item-1&quot;)\n.then(function(m) {\n    console.log(&quot;item-1&quot;, m.payload);\n});\n=&gt; Logs the item-1 on the console, or null otherwise.\n           <\/pre>\n\n            <a name=\"model.sessionStorage.get.key.subkey\"><\/a><h4>get\/+key\/+subkey<\/h4><p>\n            Get a sub element stored as <tt>key.subkey<\/tt> from the sessionStorage.\n            <\/p>\n            <pre>\nself.call(&quot;model\/sessionStorage\/get\/item-2\/a&quot;)\n.then(function(m) {\n    console.log(&quot;item-2&quot;, m.payload);\n});\n=&gt; Logs the item-2 on the console, or null otherwise.<\/pre>\n\n            <a name=\"model.sessionStorage.post.key\"><\/a><h4>post\/+key\n            Store a message under <tt>key<\/tt> in the sessionStorage.\n            \n            <pre>\nself.publish(&quot;model\/sessionStorage\/post\/item-1&quot;, &quot;Cucumbers are sometimes green&quot;);\n=&gt; New value stored.<\/pre>\n\n            <a name=\"model.sessionStorage.post.key.subkey\"><\/a><p>\n            <strong class=\"header\">post\/+key\/+subkey<\/strong><\/p><\/h4><p>\n            Store a message under <tt>key.subkey<\/tt> in the sessionStorage. When no\n            item is stored under <tt>key<\/tt> a new object is created, and <tt>subkey<\/tt>\n            is added as sub-element. When <tt>key<\/tt> exists it must be an object, then\n            <tt>subkey<\/tt> is added or overwritten.\n            <\/p>\n            <pre>\nself.publish(&quot;model\/sessionStorage\/post\/item-2\/a&quot;, &quot;hello&quot;);<\/pre>\n\n            <a name=\"model.sessionStorage.delete.key\"><\/a><h4>delete\/+key<\/h4><p>\n            Delete an element stored under <tt>key<\/tt> from the sessionStorage.\n            <\/p>\n            <pre>\nself.publish(&quot;model\/sessionStorage\/delete\/item-2&quot;);<\/pre>\n\n            <a name=\"model.sessionStorage.delete.key.subkey\"><\/a><h4>delete\/+key\/+subkey<\/h4><p>\n            Delete an element stored under <tt>key.subkey<\/tt> from the sessionStorage.\n            <\/p>\n            <pre>\nself.publish(&quot;model\/sessionStorage\/delete\/item-2&quot;);<\/pre>\n\n            <a name=\"model.sessionStorage.event.key\"><\/a><h4>event\/+key<\/h4><p>\n            Subscribe to sessionStorage updates and deletes. When entry is updated\n            you will get a notification.\n            <\/p>\n            <pre>\nself.subscribe(&quot;model\/sessionStorage\/subscribe\/+key&quot;,\n    function(m, a) {\n        console.log(m, a);\n    });\nself.publish(&quot;model\/sessionStorage\/post\/a&quot;, &quot;hello&quot;);\nself.publish(&quot;model\/sessionStorage\/post\/b&quot;, &quot;world&quot;);\n=&gt; Logs the update in the console<\/pre>\n\n            <a name=\"model.sessionStorage.event.ping\"><\/a><h4>event\/ping<\/h4><p>\n            When the sessionStorage model is enabled a retained message is published\n            on the <tt>model\/sessionStorage\/event\/ping<\/tt> topic.\n            <\/p>\n            <pre>\nlet storageReady = false;\ncotonic.broker.subscribe(&quot;model\/sessionStorage\/event\/+key&quot;,\n    function(msg, args) {\n        switch(args.key)\n        case &quot;pong&quot;:\n            storageReady = true;\n            break;\n        ...\n    });\n=&gt; When the storage is ready a pong message will be available<\/pre>\n\n            <!-- sessionId model -->\n            ","slug":"model-sessionstorage","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"f50c77a151e73779eb2255a20583991868181addffd8908ee6bf743e625ff76d","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":2723,"is_a":["meta","category"],"name":"cotonic_model","title":"Cotonic models","uri":"https:\/\/zotonic.com\/id\/cotonic_model"},"doc_source_path":"index.html","publication_start":"2026-09-30T09:11:24Z","page_path":"\/cotonic\/models\/sessionstorage","github_url":"https:\/\/github.com\/cotonic\/cotonic\/blob\/master\/index.html","pivot_location_lng":null,"doc_source_kind":"cotonic","name":"doc_cotonic_model_sessionstorage","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-09-30T09:11:24Z","uri":null,"doc_source_anchor":"model.sessionStorage","doc_status":"current","is_dependent":false,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"f88cc928b997d10f7f19e6bd0ede80e1c8c619bc","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-09-30T09:57:32Z","title_slug":"model-sessionstorage"},"uri":"https:\/\/zotonic.com\/id\/2742","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2742"}},"status":"ok"}