This article is a simple way to redirect a user away from a certain page and towards another page if they are logged in. For example: some websites want to disable their homepage or pricing pages if users are already logged in.

Copy and paste the following code snippet into the page header.

<script>
  MemberStack.onReady.then(function(member) {
    if (member.loggedIn) {
      window.location.replace(“/redirect-me-here”)
    }
  })
</script>

This code snippet will only execute for members who ARE logged in. Keep in the mind that it will affect ALL logged-in members.

Did this answer your question?