Hi Onco,
Your script part looks perfect, indeed this should trigger the Mendix Client framework to redirect to login.html when no session exists.
document.cookie = "originURI=/login.html";
I can think of the following reasons breaking the rule:
- Anonymous users are allowed in the application, then the user will never be forwarded to a login page (disable anonymous users)
- The browser's cache is serving you an older version of the index.html (try incognito window)
- The Javascript contains errors, and it doesn't reach this part of the code (check browser's console for errors)
- The user is actually not on index.html, but using index3.html or something (delete all other index-files)
Hopefully it was one of these!
If not, please share the full content of index.html