Reading the following post…
…and checking the LOGS in CONSOLE → you will recognise that your statement is correct.
- A SESSION normaly do not disappear after the page has been refreshed.
- Session: Data in session storage is available while the site visitor’s web session is active. The session ends when the visitor closes the browser tab or window. When the session ends, all the data in session storage is lost. Reloading or restoring the page does not affect session storage data. You can store up to 50kb of data in session storage.
Your imports of the storage is somekind of strange…
import { session as storage } from “wix-storage-frontend”;
Shouldn’t it be…
import {session} from 'wix-storage-frontend';
Also the question, if the MASTER-PAGE could affect the storage is resolved, since in my example, everything is working fine on the master-page.
So what else could affect the functionality of the session?
- You still have → REDNDERING_ENV
- And the fact that a login requires a page-reload? (as i can remember).
- I think the same PAGE-RELOAD happens on LOG-OUT.
But not sure anymore.
Sure that you want to use …
floating-point numbers -----> const sessionId = Math.random()
Your results must look like …
- 0.734565841051928
- 0.2970052199763069
- 0.009740853927113324
For you…