Persisting app state between termination and restart

Hi everyone, I am currently doing a project with Capacitor and would like to know if Capacitor persists app state between termination and restart.

Concretely, I would like to know why the app state is lost when a Android/iOS mobile app built with Ionic Capacitor is terminated and restarted.

Currently, when the app is terminated and re-opened, the user login is lost and the app shows the initial page, not the page that the user has left off. My desired behavior is to persist the user’s session and the current page between app termination and restart.

Is it a developer’s responsibility to persist the app state upon termination and reload it when the app starts again, or is such task handled by Ionic Capacitor? If the former is the case, any tips on how to handle it?

I wonder, how would Capacitor persist state?
Use webplatform’s tooling for that, i.e, from localStorage to indexDb to whatever (server side/services to requery…); otherwise, how else…