show page after logout

0
I have two login page, I am going to the second one with a deeplink. When a user using the second one, I tag that user with an attribute set to true. But when I log out, I have no way to redirect the user to the correct login page, because with the logout action i lost the attribute set before.   Any advice?
asked
2 answers
1

The logout page you visit is influenced by a cookie called originURI. So, if you reset the originURI on the second login page, when the user logs out they should be sent there.

For example, see this default code in a Mendix index.html file:

<script>
   if (!document.cookie || !document.cookie.match(/(^|;)originURI=/gi))
      document.cookie = "originURI=/login.html";
</script>

So within that second login page, if you use an HTML snippet widget, you could set the cookie to the deeplink URL, something like this:

document.cookie = "originURI=/link/mydeeplink;

 

answered
0

Thank you it worked! 

I just had to add some javascript in the html snippet on the two login page, and modify the index.html page (in the theme folder).

the cookie originURI was replaced after a successful login. So I put i condition to avoid that, also after a log out a wasn’t send to the url in my originURI. i Had to put an html snippet that check the value of the cookie and redirect to the correct login page if needed.

answered