Persistent localStorage not working when accessing web applications through Devolutions Gateway

Persistent localStorage not working when accessing web applications through Devolutions Gateway

avatar

Hello,
we are running into an issue when accessing web applications through the Devolutions Gateway.
When connecting directly (without the Gateway), user-specific settings of the web application are stored in the browser’s localStorage and persist across sessions as expected.

However, when connecting through the Gateway, these settings are lost every time the session is closed and reopened. After some analysis, the reason seems clear:

  • The browser only persists localStorage per origin (scheme + host + port).
  • When using the Gateway, the session is usually exposed as https://127.0.0.1:<randomPort> or via a dynamic relay path.
  • Because the port/path changes on every connection, the origin is never the same.
  • As a result, the browser creates a new, empty localStorage container each time, and the previously saved settings are not visible anymore.

This is not an issue with cookies (those might be handled differently), but specifically with localStorage, since it is strictly tied to the origin.

Question:
Is there any way to configure the Gateway / RDM so that a stable origin is used (e.g., a fixed URL or fixed port), so that localStorage can persist across sessions?
If not, would it be possible to consider this as a feature request for the Gateway? Having a stable origin would solve the problem and allow web applications to properly persist user settings.
Thanks!

All Comments (1)

avatar

Hello adillinger1,
You are correct the reason localStorage is lost is because the Gateway uses a loopback address with a dynamic port or relay path, so the browser origin changes each time. At the moment there is no option to configure a fixed localhost port or stable URL in Gateway, which is why localStorage cannot persist across sessions.

A possible workaround is to publish the web applications through a reverse proxy with a stable FQDN, which ensures a consistent origin and allows localStorage to be preserved.

If you’d like, I can also submit this as a feature request so the team can consider adding support for stable origins in future versions of the Gateway.

Best regards,

Michel Audi