Save & restore Session


#1

I wasn’t able to find anything in the user manual about saving and restoring the state if i close and re-open my osjs session.

Can you point me where i can find a way to do that and how many ways are there to store session

Thanks


#2

Do you mean in an application you’re developing ?


#3

If that was the case, I’ve added it to the application tutorial:

https://manual.os-js.org/v3/tutorial/application/#launch-arguments


#4

Ops, I had some errors there. So if you’ve already looked at it – do a hard refresh of the page!


#5

If I close my chrome browser tab within which my os.js was running and i reopen it then i want to restore all the applications that were previously opened within os.js. I read in your manual that currently this is done by using browser local storage but it is not recommended for production as it has memory leaks. I wanted to know if this session can be stored say in a database like oracle or something else and where/how to do this kind of configuration.


#6

Currently your session is only stored when you save it from the menu. Rolling session updates is supported, but has not been added to the applications yet.

You can see it’s on my TODO list here:

Yes, it can. However, I have not published the modules yet (only the authentication ones as of now). This is also on the TODO list.

I’ve already created the manual on how to change the functionality: https://manual.os-js.org/v3/guide/settings/

Might actually publish that one today. I’ll let you know.


#7

I just realized I forgot to update the included fs module, so I’ll fix asap as well :blush:


#8

Well, I published the database storage module:


#9

I’ve fixed this as well, so run npm update to get the latest @osjs/server :slight_smile:


#10

I’m going to translate this into a authentication adapter as well so there’s an identical solution for that too.

Currenty there’s only the standalone sqlite module, which will probably be deprecated after this.


#11

Published as well :blush:


#12

Cool! Thanks! I will do the update and check out the new module. Will get back to you in case i have any questions.