Maintaining login status and custom data while navigating between applications

We've developed a number of (separate but related) Perspective applications, with a shared menu that lets users navigate between them all, with links such as:
(which all open in the same browser window)

When a user logs in on one application, I'd like the user to stay logged in while they navigate to any of our applications. However, it seems that each application maintains its own session (so, session.props.auth.user.userName gives a different result depending on which application we are currently looking at). Same with trying to set custom session parameters, such as the currently selected site id.

Any suggestions on how I can do this?

Anybody? :frowning:

Combine into one application. :man_shrugging:

A third party IdP might allow you to keep login state between Perspective applications, depending on how generous it feels.

As for sharing state, you could use system.util.getGlobals() to cache things at the JVM level, but the trick then becomes having a persistent key that works in both application A and B.


I mean, that would solve the problem, I guess. But once we've got, say, ten applications with a bunch of different people working on them, version control/merging gets really messy if they're all combined into one ignition project.

Consider using project inheritance to help manage the development process, if you have to develop on your production system. Make an inheritable project that holds your well-tested content. Make a 'stable' leaf project that inherits from that, and adds the per-leaf stuff that doesn't work well with inheritance. Make developers work in their own projects, inheriting from the same base, and overriding what they need. Then, when well-tested, "send" the resources to the base project and delete the development leaf. Tweak the "stable" leaf to accommodate the new resources., there's no way to do this within Ignition itself? I guess I'd initially assumed a session was going to be a browser/user session, rather than a project specific session.

It's not the end of the world, was just hoping to save the user a bit of frustration when moving around through our applications.

Each project has its own IdP or user source setting, and its own security settings.

Ok, that could be worth a try. My main concern would be trying to sync everything back up again (and handling conflicts, where two developers are editing the same resource).

What we have at the moment is a CORE project, which all other projects inherit from, which contains functions/views/queries which might be useful across multiple applications (including standard header bar/menus). Then, we've got multiple developers building projects on their own machines, committing to github, then exporting/importing to a test server, then finally to production. Seems to work pretty well, apart from this session issue.

You can make a chain of inheritance, inserting another layer between CORE and the stable leaf. With git in the middle (not necessarily github), each developer working in their own leaf should be quite easy to merge when ready to deploy. Then merge the "resource send" operation separately. Lots of options when using git.