I'm trying to return or stay at the current view after doing perspective.login() or perspective.logout()
I managed to do it when doing a login but not logout. Does anyone have a solution for this?
Tried Session Events script, change script on session prop and Event on my header view. I'm storing my variables as a custom session prop and try to do perspective.navigate).
Are you navigating to views rather than pages in this case?
logout()/login() would not impact the current URL that the browser/session was previously looking at. At least not in my testing.
When logging out I'd expect to lose other information besides the current URL, so if you are talking about popup views not remaining for example. Depending on what exactly you are trying to persist you could track user-specific information per user, that would need to exist on a dataset tag or in the database and be retrieved on session startup (not on session props in this case, those won't persist through logout).
Storing the last view cannot be linked to user, it has to be device in that case. device.identifier maybe? last parameters and timestamp, so we don't pull up old sessions.
(Thinking out loud)
The case: This is control room clients, and they don't need to log in just to see (security zones), it's first when they want to do any changes they would need to log in. Going back to start after log out is not desired.
If it based on client-device, then you can try to use session props very heavily, and setup the persistence based on a per client basis like you are thinking. host, address or the device.identifier each might work.
Depending on what sort of "focus" is being persisted, you may be able to setup a few custom session props that represent the main items that your users are toggling between. You can then setup simple writes to those session props to keep track of the most recently focused items and save and load the session props on shutdown/startup. Ideally most of the resources that users are reloading after authenticating, are then driven by these session props that are syncing to the saved session-level data. It really depends on what exactly (how much property info) you're trying to persist.