# How to preserve a custom state even after page refresh

**URL:** <https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488>\
**Category:** App Organization\
**Created:** [November 15, 2024, 12:54pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488 "2024-11-15T12:54:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjk22071998](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mjk22071998](https://forum.bubble.io/u/mjk22071998)\
**Post date:** [November 15, 2024, 12:54pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488/1 "2024-11-15T12:54:56Z")

</div>

I am getting a value from the user in a popup based on that value then the page gets populated. I am saving the value in popup’s custom state but when I refresh the page the state gets empty, is there any way to preserve the custom state or value that it remains same even after page refreshes, I don’t want to save the value in database as this value will be changed whenever the page is visited so there is no point this temporary value in database

---

<div class="post-metadata">

**Author:** ![NoCodePhill](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodephill/32/231606_2.png) [@NoCodePhill](https://forum.bubble.io/u/NoCodePhill)\
**Post date:** [November 15, 2024, 1:13pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488/2 "2024-11-15T13:13:39Z")

</div>

Custom states are temporary by their nature, so either you set the state on page load, have a field on the user that stores the value, or a data-type that stores the value and populates it.

---

<div class="post-metadata">

**Author:** ![adamhholmes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adamhholmes/32/100510_2.png) [@adamhholmes](https://forum.bubble.io/u/adamhholmes)\
**Post date:** [November 15, 2024, 1:17pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488/3 "2024-11-15T13:17:16Z")

</div>

> [@mjk22071998](#):
>
> is there any way to preserve the custom state or value that it remains same even after page refreshes, I don’t want to save the value in database as this value will be changed whenever the page is visited so there is no point this temporary value in database

You can use local/session storage for this (not native Bubble functionality, but very simple to do with some custom Javascript or a plugin).

---

<div class="post-metadata">

**Author:** ![nocodejordan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodejordan/32/123255_2.png) [@nocodejordan](https://forum.bubble.io/u/nocodejordan)\
**Post date:** [November 15, 2024, 1:25pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488/4 "2024-11-15T13:25:04Z")

</div>

Why not use url parameters for this?

---

<div class="post-metadata">

**Author:** ![mjk22071998](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mjk22071998](https://forum.bubble.io/u/mjk22071998)\
**Post date:** [November 15, 2024, 1:26pm UTC](https://forum.bubble.io/t/how-to-preserve-a-custom-state-even-after-page-refresh/348488/5 "2024-11-15T13:26:38Z")

</div>

Yeah, Nice idea thanks, Navigating to the same page with URL parameter, Thanks it really helped
