Mendix Docker container login fails on VM, Cookie not being set

0
Hi everyone, I'm experiencing a login issue when deploying a Mendix application using a Docker image. Environment: Image: Based on Mendix Buildpack (latest) Database: Postgres Accessing the container from a VM with port mapping working correctly Issue: Accessing from my local machine works fine: login succeeds, Cookie is set, and I can access the homepage. Accessing from the VM: the page loads, but after login it stays on the login page, and the browser does not set the Cookie. Suspected cause: Possibly a compatibility issue with the Buildpack version Help needed: Has anyone encountered a similar issue or found a solution?
asked
1 answers
1

From your explainations, that points to a cookie handling / session storage issue which might be related with your docker environment settings or any proxy server in between might be stripping of the cookies. 

  • Do you access to VM via http or https ?
  • Do you use a hostname or IP?
  • Is that hostname /IP configured in your docker runtime variable? (MXRUNTIME_ApplicationRootUrl)
  • Is there a reverse proxy in between your browser and the VM? (which may strip/modify cookies).

When you click the login button, server sends a set cookie response in the first XAS packet. You can check what cookie is your server setting by opening browser's dev tools (F12) -> Network Tab -> first XAS request after you click login button. If there is no domain in the set cookie message, your browser may assume it is a cookie for localhost. but since you are accessing the VM via IP/FDQN name, this means it is a cross site cookie.

 

Since 2020 (chrom 80+) if cookie is cross site (SameSite=None) it must have Secure parameter. Otherwise chrome will not accept that cookie. If there is a Secure parameter, then you need to access to the server via https otherwise cookie is not accepted by the browser.

 

 

answered