I have a website with multiple pages. Each page has a "Save as Draft" method that will save the users progress. I have a session timeout of 40 minutes, and I was wondering how I would make it so that whenever the session is expired, the page automatically calls "Save as Draft" (so it's not lost)
How would I start on doing something like this?
You can't: the session expires server side and cannot send a message to the browser (it doesn't even know whether the user still sees the page or has closed the browser).
You could set a client-side timeout to save the page (as draft) to the server, but this has the effect of refreshing the session! So maybe just do an automatic "save as draft" every 5 - 10 minutes, thereby keeping your session (plus a draft copy of the work done).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With