A session is by development kept on the server. It’s server side of keeping things stored that are stored in a state Client side (browser,...), so temporatly.
A session also is something that is garbage collected when not in use anymore (user logs out, or the programmed time-out is reached).
In offline-first development a session as a hook for something is never a good idea, because the development is about offline-first, and since offline there is no session available (or shouldn’t be) you need to create something else as hook to keep data stored.
One of the best ideas i can come up to store data for 1 specific user, without the need of storing it on the server in the database, would be to store it in local storage (the storage in the device the user is using). if it should be available in other devices as well, then you need to create an entity as a hook, and make sure it gets synchronized.
I hope this can help you out a bit.
Hi David,
With session I meant ‘local’ session, like something a service worker would create: I don’t know the mx technical specifics that keeps me from having to log in every time I (re-)open the app, that’s why I chose the term :) The $Session is not available offline and there is no logic/entity tied to it, as you are right that this would be a bad idea: I’d also not do it in an online model but that’s a different story.
So unfortunately the answer does not help me any further, but thanks for answering!
FYI I’m pretty sure I’ve caught a platform (module) bug, a ticket has been submitted. I will add any updates to this question for future reference.