Session Data being null on server restart

Topic summary

Problem: After Heroku restarts, the server loses session data, causing a theme app extension’s REST Admin API calls to fail unless the admin app is relaunched.

Details: The app attempts a root API call on each restart, but the session is null at that moment, so the request cannot complete. The developer notes they can retrieve session data via middleware when it exists and asks if there’s a way to automatically create or refresh the session on server restart, or update it on demand, so API calls work without opening the app from the admin portal.

Status: No solution or workaround was provided. A follow-up post asks whether the issue was resolved, indicating the discussion remains open with unanswered questions.

Summarized with AI on December 31. AI used: gpt-5.

Hi Everyone,

I have theme app extension that will make some admin api calls. For that, I have deployed the server in heroku. But whenever heroku restarts the server, without launching the admin app I am unable to get the session data which is necessary to process the Rest admin API calls. Is there a way to update the session on every server restart automatically?

I know it tries to do the root api call on every restart. but, the session was null at that time so, we are not able to process the request completely. I have a middleware where I can able to get the session data. Is there a way to create a session and update it on demand so that the APIs will work without relaunch of the application from the admin portal.

Thank You

hey did you solve ?