Issue with cookie ‘_ms-mid Answered

Post author
zhaojun wang

Hello,is the ‘_ms-mid’ cookies deprecated? I’m using memberstack2.
after I login in, this cookie ‘_ms-mid’ is not generated, but a few days ago it exists.

Comments

30 comments

  • Comment author
    Julian Galluzzo

    It shouldnt be - I was doing something yesterday with it and it worked perfectly fine

    0
  • Comment author
    zhaojun wang

    Yes, I found it put inside the LocalStorage, not in cookies anymore, is there any announcement about this change?

    0
  • Comment author
    Julian Galluzzo

    I still see this, it's what tracks the session so i dont think its gone anywhere

    0
  • Comment author
    zhaojun wang

    Can you log out and log in again, and then check the _ms-mid which is still in the cookies?

    0
  • Comment author
    Julian Galluzzo

    it's still there for me!

    0
  • Comment author
    zhaojun wang

    ok, thank u very much! Do you use memberstack2?

    0
  • Comment author
    Julian Galluzzo

    I do! Feel free to send me your site and I can test from my side

    0
  • Comment author
    zhaojun wang

    ok, are you the stuff of ms company?

    my site is under development, which url is https://www.jobwizard.ai
    login url: https://www.jobwizard.ai/login
    thank u!

    0
  • Comment author
    Julian Galluzzo

    I am! And I will try now 🙂

    0
  • Comment author
    zhaojun wang

    👍

    0
  • Comment author
    Julian Galluzzo

    this is strange, and it's definitely the first time I've seen it - everything is exactly as you described.

    CC Tyler Bell Josh Lopez

    Any idea about this? The _ms-mid is actually going to the local storage, instead of cookies - see photos

    0
  • Comment author
    Tyler Bell

    The cookie is deprecated. Local storage is used now.

    We made the switch to local storage because of compatibility issues with Safari.

    Julian, this is what my post about cookies was about yesterday.

    Julian if you logged out and logged back in and still see a cookie, it most likely is because your browser is still using the old MemberStack script version. A quick cache clear should fix that. M

    0
  • Comment author
    Julian Galluzzo

    My apologies - I fixed the script for the concurrent login solution - zhaojun wang if you need any help with switching your implementation, just let me know 🙂

    0
  • Comment author
    zhaojun wang

    We are using the chrome plugin, which is running in a third-party web page to start the chrome plugin to read the value of _ms_mid, and submit it to the back-end and then using JWT to verify the token. After changing it to LocalStorage, our chrome plugin can’t read the value of ‘_ms_mid’ , because chrome extension running in the third-party website(eg. https://boards.greenhouse.io/amwell/jobs/6674651002), and ‘_ms-mid’ stores in our webflow site(www.jobwizard.ai)

    Is there any good solution?

    0
  • Comment author
    Julian Galluzzo

    You should be able to do exactly what you're doing and just pull the info from the localstorage instead of the cookie data - check this out https://stackoverflow.com/questions/3937000/chrome-extension-accessing-localstorage-in-content-script

    0
  • Comment author
    zhaojun wang

    I attempt to get the value of ms-mid, but return undefined.

    May be I think the _ms-mid value is in the localstorage of page www.jobwizard.ai (photo1 below), but our chrome extension runs in greenhouse page(photo2 below).
    the chrome extension api for localstorage is(we can see, no domain parameter that is different from cookies):

    chrome.storage.local.get([“_ms-mid”]).then((result) => {
    console.log(“********* _ms-mid in localstorage currently is ” + result.key);
    });

    as we know so far, we cant read the value of _ms_mid right now in our chrome extension after change to localstorage. Is that possable to give us a choice to reserve ms-uid cookies?

    0
  • Comment author
    Tyler Bell

    Are you using the webflow package or the dom package?

    0
  • Comment author
    zhaojun wang

    I am using this code below, and insert this code into webflow header area.

    <!-- Memberstack webflow package -->
      <script data-memberstack-app=“app_clg1kfl81003n0ulidqbtb1c2” src=“https://static.memberstack.com/scripts/v1/memberstack.js” type=“text/javascript”></script>
    0
  • Comment author
    Tyler Bell

    Can you do something like this then?

    window.$memberstackDom.getMemberCookie()
    0
  • Comment author
    zhaojun wang

    yes , I tried just now, return the cookie of the current user like this, is this the same value as _ms-mid?

    eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjZmNjU3ZGRiYWJmYmZkOTVhNGVkNjZjMjMyNDExZWFhNjE5OGQ4NGMxYmJkOGEyYTI5M2I4MTVmYjRhOTlhYjEifQ.eyJpZCI6Im1lbV9jbGc1NmgzN3MwM2NuMHJlNTZhMGVjZmE5IiwidHlwZSI6Im1lbWJlciIsImlhdCI6MTY4MTgzMzA4MSwiZXhwIjoxNjgzMDQyNjgxLCJhdWQiOiJhcHBfY2xnMWtmbDgxMDAzbjB1bGlkcWJ0YjFjMiIsImlzcyI6Imh0dHBzOi8vYXBpLm1lbWJlcnN0YWNrLmNvbSJ9.gUZ1zMVsK38c1e0xGM2CX5YTp9RwGE23syHroq7q3abOp1uUDoBAZP9HHZQ4Zzm2bzZItIhTGb8K3Txczwqgls6yFBMjJ0hKid207eXV29Ramp1JBJlthFn1tdGZQguUNa1riHGdUVUF7Z-WxCpv2cpXZMUO72-mzdyfgYnBkpuBI6beXIX1b-m91hA_10XTAWMVQ4sDILZyx8ReSHz_d2C4XiTz6W4SVW0Eq3JZrgf18OgyPZAUmqm7-QdRPln6yWdXSyVxoaUw2dXzWjxNf429dZBmmHGg_yufUz3ys7DOKBdWGUNrarmiJhRz4-mnh3-CgHSKA9jzkqupYkKpZg

    0
  • Comment author
    Tyler Bell

    Yep!

    0
  • Comment author
    zhaojun wang

    And what can wedo as follows, you means that we manage this cookie by outself, add this cookie when login and remove it after logout?

    0
  • Comment author
    Tyler Bell

    You shouldn’t need to manage anything by yourself.
    What are you trying to do?

    Is your chrome extension no longer working?

    0
  • Comment author
    zhaojun wang

    yes, It’s no longer working right now. Our chrome extension could not read ms-mid value from localstorage, as the extension runs in the third party webiste.

    0
  • Comment author
    Tyler Bell

    You can read the value with

     window.$memberstackDom.getMemberCookie()

    disregard the name of the method. It pulls the value from localstoragge

    0
  • Comment author
    zhaojun wang

    ok, but the code “window.$memberstackDom.getMemberCookie()” cannot run in the chrome extension.
    we need a cookie that can be read by the chrome extension.

    0
  • Comment author
    Tyler Bell

    Does the chrome extension not have permission to access local storage?

    0
  • Comment author
    zhaojun wang

    the chrome extension just have permission to read local storage of the current page.

    but the chrome extension runs in the third party page, in our case, for example, our extension runs in greenhouse page.

    so, in our case, the extension do not have a way to read the localstorage of ‘_ms-mid’

    Tyler Bell Is it possible to provide an option to generate a ms_mid cookie after the user logs in?

    0
  • Comment author
    Tyler Bell

    If you are using the webflow script just add data-memberstack-use-cookies to the script tag. So you’d have something like…

    <script data-memberstack-app="you app id" data-memberstack-use-cookies src="https://static.memberstack.com...." type="text/javascript"></script>

    If you are using the dom library, you can just pass in useCookies:true to the init function.

    const memberstackInit = memberstackDom.init({
    	publicKey,
    	appId,
    	useCookies: true
    })

    @zhaojun wang please see my above message.

    We added a feature where you can still use cookies.

    0
  • Comment author
    zhaojun wang

    thank you!!!👍👍

    0

Please sign in to leave a comment.