notes about local storage vs session storage

This commit is contained in:
David Botton 2021-02-05 12:55:27 -05:00
parent 94da1766cd
commit 9872e3310d
3 changed files with 9 additions and 4 deletions

View file

@ -5,6 +5,7 @@
(in-package :clog-user)
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 9")
(let* (last-tab
;; Note: Since the there is no need to use the tmp objects
;; we reuse the same symbol name (tmp) even though the

View file

@ -5,6 +5,7 @@
(in-package :clog-user)
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 10")
(let* ((canvas (create-canvas body :width 600 :height 400))
(cx (create-context2d canvas)))
(set-border canvas :thin :solid :black)

View file

@ -5,6 +5,7 @@
(in-package :clog-user)
(defun on-new-window (body)
(setf (title (html-document body)) "Tutorial 14")
(set-on-click (create-button body :content "Set Local Key")
(lambda (obj)
(declare (ignore obj))
@ -28,10 +29,12 @@
(create-div body :content (format nil
"<H1>Local Storage vs Session Storage</H1>
<p width=500>
The value of local storage persists in browser cache even after browser closed.
If you reset this page the session storage key will remain the same, but opening
in another window or tab will be a new session, but if it came from a click from
this window the session keys are copied first to the new window.</p>
The value of local storage persists in the browser cache even after the browser
is closed. If you reset this page the session storage key will remain the same,
but openning this page in another window or tab will be a new session. If the
new window came from a click from this window, the session keys (on some
browsers are copied first to the new window, if you wish to persist data accross
windows use local storage instead.</p>
<br>
<a href='.' target='_blank'>Another Window = Different Session</a><br>
<br>