# Vuex data removed when zoom ( ZoomMtgEmbedded ) meeting leave

**URL:** <https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885>\
**Category:** Web\
**Created:** [January 19, 2022, 12:30pm UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885 "2022-01-19T12:30:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajayk](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ajayk/32/34216_2.png) [@ajayk](https://devforum.zoom.us/u/ajayk)\
**Post date:** [January 19, 2022, 12:30pm UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885/1 "2022-01-19T12:30:55Z")

</div>

**Description**  
I am using the Vue js and using ZoomMtgEmbedded to integrate the component UI of zoom.

When I leave the meet as host then all the data in vuex is cleared.

**Browser Console Error**  
NO Console log error

**Which Web Meeting SDK version?**  
2.1.0

**Meeting SDK Code Snippets**

initEmbedClient() {  
this.client = ZoomMtgEmbedded.createClient();

```
  const tmpPort =
    window.location.port === "" ? "" : ":" + window.location.port;
  const avLibUrl =
    window.location.protocol +
    "//" +
    window.location.hostname +
    tmpPort +
    "/lib";

  this.client.init({
    debug: false,
    zoomAppRoot: document.getElementById("meetingSDKElement"),
    language: "en-US",
    assetPath: avLibUrl,
  });
},
async joinAsHost() {
  this.initEmbedClient();

  const signature = await generateHostSignature(this.meetingNumber);

  this.client.join({
    apiKey: process.env.VUE_APP_ZOOM_API_KEY,
    signature: signature,
    meetingNumber: this.meetingNumber,
    userName: `${this.userDetails.userFirstName} ${this.userDetails.userLastName}`,
    password: this.meetingPassword,
    userEmail: this.userEmailId,
  });
},

async joinAsStudent() {
  this.initEmbedClient();

  const signature = await generateParticipantSignature(this.meetingNumber);

  this.client.join({
    apiKey: process.env.VUE_APP_ZOOM_API_KEY,
    signature: signature,
    meetingNumber: this.meetingNumber,
    userName: `${this.userDetails.userFirstName} ${this.userDetails.userLastName}`,
    password: this.meetingPassword,
    userEmail: this.userEmailId ? this.userEmailId : "",
  });
},

```

},

**Device (please complete the following information):**

- Device: Dell
- OS: Ubantu
- Browser: [e.g. Chrome]

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 22, 2022, 1:51am UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885/2 "2022-01-22T01:51:58Z")

</div>

@ajayk My understanding is that this is because the page refreshes and the Vuex store is located in the memory for the page. I recommend caching the Vuex store to localStorage and use the current version as the key to allow for cache-busting.

Here is a guide on just that:

> **[Vue: Using localStorage with Vuex store - Mike Street - Lead Developer and CTO](https://www.mikestreety.co.uk/blog/vue-js-using-localstorage-with-the-vuex-store/)**
>
> Using the browser's localStorage we can create a Vue app which has its Vuex store cached. This allows the user to navigate away from the app and not lose their preferences.

I hope that helps!

---

<div class="post-metadata">

**Author:** ![ajayk](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ajayk/32/34216_2.png) [@ajayk](https://devforum.zoom.us/u/ajayk)\
**Post date:** [January 24, 2022, 7:03am UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885/3 "2022-01-24T07:03:42Z")

</div>

Our application must have to store data in session storage. Is there any other way to maintain with ZoomMtgEmbedded using vuex

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 25, 2022, 8:38pm UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885/4 "2022-01-25T20:38:46Z")

</div>

@ajayk You can essentially follow that guide but store the values in sessionStorage instead of localStorage.

Here’s a guide on using a package called Vuex-Persist that handles a lot of that for you. In the guide where it says to use window.localStorage, you would just use [window.sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage):

> **[Store Vue data to localStorage using Vuex](https://flaviocopes.com/vuex-persist-localstorage/)**
>
> Learn how to store Vuex data automatically to localStorage or sessionStorage

Let me know if that helps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [February 25, 2022, 6:39am UTC](https://devforum.zoom.us/t/vuex-data-removed-when-zoom-zoommtgembedded-meeting-leave/62885/5 "2022-02-25T06:39:05Z")

</div>

Closed on February 25, 2022, 6:39am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
