# Read a cookie on page load

**URL:** <https://community.weweb.io/t/read-a-cookie-on-page-load/1740>\
**Category:** Ask us anything\
**Created:** [January 22, 2023, 9:07pm UTC](https://community.weweb.io/t/read-a-cookie-on-page-load/1740 "2023-01-22T21:07:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![billdonnelly](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@billdonnelly](https://community.weweb.io/u/billdonnelly)\
**Post date:** [January 23, 2023, 1:01pm UTC](https://community.weweb.io/t/read-a-cookie-on-page-load/1740/5 "2023-01-23T13:01:41Z")

</div>

Thanks Alexis,

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?

---

_[View the full topic](https://community.weweb.io/t/read-a-cookie-on-page-load/1740)._
