# Use same Custom States in different sites

**URL:** <https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235>\
**Category:** Need help\
**Created:** [February 19, 2024, 2:16pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235 "2024-02-19T14:16:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jupixy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jupixy/32/235995_2.png) [@jupixy](https://forum.bubble.io/u/jupixy)\
**Post date:** [February 19, 2024, 2:16pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/1 "2024-02-19T14:16:44Z")

</div>

Hi all,

I’m currently creating a website.  
I provide a button, that the user can switch the language between german and english. I want to store the value in a custom state variable (text; “de”/“en”) and I want to deliver the correct text from the database. Works fine, but I designed my page in different single-pages for seo reasons.  
so if the user clicks a link in the navigation bar, another site will load and the text will be shown.  
Now, if the user clicks the language button, a custom state “lang” is set (e.g. “en”) and the workflow opens an external page, for example:

[www.mypage.com/about](http://www.mypage.com/about)

“about” is the slug. The page will load and I want to display the data (text) from the db, but my slug is empty after a new url is loaded. I thought, the custom state will be stored internal (cookie or so…) and I can use the value on another page again.  
Is there a way to achieve this? I dont want to submit the lang-option in the url.

best,  
jupxi

---

<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:** [February 19, 2024, 2:23pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/2 "2024-02-19T14:23:30Z")

</div>

> [@jupixy](#):
>
> I thought, the custom state will be stored internal (cookie or so…)

No… custom states are just page-level variables…

If you need to store data in a more persistent way then, aside from using the database, you can use local/session storage (or cookies)…

---

<div class="post-metadata">

**Author:** ![jupixy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jupixy/32/235995_2.png) [@jupixy](https://forum.bubble.io/u/jupixy)\
**Post date:** [February 19, 2024, 2:24pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/3 "2024-02-19T14:24:48Z")

</div>

okay. thanks for this basic inforation 😉  
doesn [bubble.io](http://bubble.io) support cookies/local storage out of the box or do I have to use custom plugins or custom code?  
any tipps?

---

<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:** [February 19, 2024, 2:33pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/4 "2024-02-19T14:33:28Z")

</div>

> [@jupixy](#):
>
> doesn [bubble.io](http://bubble.io) support cookies/local storage out of the box or do I have to use custom plugins or custom code?

The latter…

(although, unless your use case is for non-authenticated users, using the database for this would be the simplest, and most logical approach).

---

<div class="post-metadata">

**Author:** ![jupixy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jupixy/32/235995_2.png) [@jupixy](https://forum.bubble.io/u/jupixy)\
**Post date:** [February 19, 2024, 3:15pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/5 "2024-02-19T15:15:58Z")

</div>

I think it would be not useful to store data for every single visitor of my public website. 😉

---

<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:** [February 19, 2024, 3:27pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/6 "2024-02-19T15:27:57Z")

</div>

> [@jupixy](#):
>
> I think it would be not useful to store data for every single visitor of my public website. 😉

Why not? (Bubble does that already for you anyway).

But if your use case is for non-authenticated Users, then Local Storage is the way to go.

---

<div class="post-metadata">

**Author:** ![jupixy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jupixy/32/235995_2.png) [@jupixy](https://forum.bubble.io/u/jupixy)\
**Post date:** [February 19, 2024, 3:47pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/7 "2024-02-19T15:47:28Z")

</div>

do you have any examples or links for this usecase?

is it possible to read/write a cookie/local storage-object and provide it in a Custom State or something that I can re-use the parameter in my bubble app (if is “en” then let =

---

<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:** [February 19, 2024, 3:57pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/8 "2024-02-19T15:57:22Z")

</div>

Well there’s no need to use custom states if you’re using local storage.

Personally I’d just use a JavaScript to bubble element for this… but you can check out plugins such as Floppy if you want to simplify things.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 29, 2024, 2:17pm UTC](https://forum.bubble.io/t/use-same-custom-states-in-different-sites/308235/9 "2024-04-29T14:17:08Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
