Keep session alive for X min, not when the browser is closed or PC is suspended

Hi,

I'm developing an app that will take CSV files from the user and will run some heavy analyses on them, so it will take a while to finish.

Many of the times the user leaves the app running and goes away, hence the PC will enter in suspension/hibernation. Either that or the user closes the browser.

Is there a way keep the session alive for a few hours even though the browser is not open or the user's PC is suspended?

What I've tried: