title: Cookie values do not get properly updated - Vue cookies
body: <p>Here's what I want to do:</p>
  <p>I am looking to store user preferences (Possibly 2-3 users max) in a cookie so they are readily available.</p>
  <p>Upon login, I check if I have an existing 'users' cookie and if not, I create it. If it exists, I check if my current user is inside this cookie. If not, I add him, with empty prefs.</p>
  <p>vue: 2.4.16
  vue-cookies: 1.7.4</p>
  <pre><code>   loggedIn (userId) {
        this.profile = userId
        this.userConnected = true
        if (this.$cookies.isKey('users')) {
          const userBase = JSON.parse(this.$cookies.get('users'))
          const found = userBase.findIndex(user =&gt; user.profile === this.profile)
          if (found === -1) {
            console.log('new user, add to cookie')
            const newUser = {
              profile: this.profile,
              preferences: {
                cursor: null,
                wallpaper: null,
                theme: null
              }
            }
            userBase.push(newUser)
            this.$cookies.set('users', JSON.stringify(userBase), 604800)
          }
        } else {
          console.log('no cookie, create users cookie')
          const newUsers = [
            {
              profile: this.profile,
              preferences: {
                cursor: null,
                wallpaper: null,
                theme: null
              }
            }
          ]
          this.$cookies.set('users', JSON.stringify(newUsers), 604800)
        } 
  </code></pre>
  <p>So far so good. Everything seems to work properly.
  I then have my function to update preferences and update the cookie. The problem occurs when I have more than one users in my cookie. The first object in my cookie array will always get modified properly, but any other user in the Array will be ignored completely. This only happens with the cookie, the data that I'm pushing into the cookie is looking good. Here's more details:</p>
  <pre><code>updatePreferences (preference, data) {
     //- We are getting the Users cookie, and finding the current active user
     const globalPreferences = JSON.parse(this.$cookies.get('users'))
     const userIndex = globalPreferences.findIndex(user =&gt; user.profile === this.$store.state.User.userProfile)
     const currentUser = globalPreferences[userIndex]
  
     if (preference === 'wallpaper') {
        currentUser.preferences.wallpaper = data
        globalPreferences.splice(userIndex, 1, currentUser)
        //- globalPreferences is always properly updated. The console log always reflects the changes
        const updatedData = JSON.stringify(globalPreferences)
        //- The cookie does not properly update. Only the first index ever gets updated, the rest never changes.
        this.$cookies.set('users', updatedData, 604800)
     }
  }
  </code></pre>
  <p>I am definitely lost here. I have tried removing the cookie before updating it again, but without luck either. Any help would be appreciated. Thanks!</p>
  <p><strong>First user update - Console log (Works properly)</strong></p>
  <h2><a href="https://i.stack.imgur.com/CewHe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CewHe.png" alt="enter image description here" /></a></h2>
  <p><strong>Second user update - Console log (Cookie does not update value)</strong></p>
  <p><a href="https://i.stack.imgur.com/sy36u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sy36u.png" alt="enter image description here" /></a></p>