show page after logout

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?
3 answers

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:

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

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;



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.


I am trying to achieve the same thing: when a custom login page is used, and the user signs out, i want him to be redirected back to the custom login page. 

In the login page, i set the cookie. I checked and the originURI is set to “/p/zr” . This stays like that during the session. 

However when the user signs out (the standard  sign out button in the top bar, triggering the ‘sign out’ event on click) , the standard login screen is shown (not the custom one used to login).

What is not correct here?