I believe (from prior community discussions) that there isn’t a native weweb way to read or set browser cookies on page load to maintain state between visits. Just checking if that is still the case and if anyone has tried doing that with Javascript.
To clarify, I can use JS (i.e document.cookie=“user=yes”) to set the cookies. I’m not sure how to read it back into a weweb variable on the next page load after a browser exit.
In order to maintain state between visits you can use the localstorage feature of your variables. Cookies is more when you want an information to be sent with your requests. If you only need to maintain a front-end state, local storage is the way to go, and the easier one.
If I can describe the use case further, when an existing user makes a return visit to my website after closing the browser, I wanted to be able to know (on page load) that this is an existing user and apply some conditional logic.
Are variables in local storage automatically initialized on page load?