(Phone profile) Cookie originURI set to a different page then the login.html page after navigating to this other page

0
Here is what I want to achieve. I have a login page with a button on it to login via SSO and login/passwd fields for application managers or testers. (I get the feeling it has to do with the phone profile and maybe also with the preview option) I want to separate this in two pages, with a button on the the std login page that sends the user to the application managers page. So I have two pages: login.html login-applicationmanagers.html   This does work apart from the fact that the originURI is set to the /login-applicationmanagers.html. As a consequence, the login-applicationmanagers.html page is now shown after an application manager logs out. That’s not what I want. I always want the login.html page to be shown first. I found out the originURI cookie is causing this but I don’t know how to manipulate this behaviour. The cookie is always set to the login-applicationmanagers.html page when the button is clicked. What should I do differently? === EDIT === Deployed to the cloud, I did not experience the same problem. originURI is set to login.html on logout. My assumption now is that there is an issue with the preview. === EDIT === Problem solved. Turned out an error prevented the cookie for login.html from being set. The error was caused by the removal of some standard loginpage items as the username and password. The javascript processing the login.html page missed these items and gave an error and, as a consequence, never reached the part where the cookie was being set. I fixed by adding the items back to the page and hiding them. Question that remains is why javascript that requires the username and passwd attributes is executed and how I could prevent it from executing. ==> Still a lot to learn for me in this area :-)
asked
1 answers
1

Hi Toon,

This cookie is set by Mendix in login.js. There are multiple possible solutions to this problem. You can customize login.js to set a different cookie, or overwrite the cookie using a nanoflow after login. I'd say the first is probably the better option. Follow the steps described here to add login.js to your theme folder, then find the part that needs to be changed. You will want to change location.pathname to “login.html”, to hardcode it to redirect to login.html after logout.

        "originURI=" + location.pathname,

 

answered