Override Memberstack to use cookies instead of local storage

Article author
Josh Lopez
  • Updated

By default, Memberstack uses the browser's local storage to allow members to refresh the page and still be logged in. In the past we used cookies but some browsers do not allow cookies (Safari) without having to click on some browser settings so we decided to use local storage instead. Only use this cookie override if it is absolutely necessary for your app or website.

If you are using the Memberstack Webflow Package and would like to override Memberstack to use cookies instead of local storage you will need to add data-memberstack-use-cookies to the install script like:

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

If you are using the Memberstack DOM Package and would like to override Memberstack to use cookies instead of local storage you will need to add useCookies: true to the install script like:

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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.