Problem with Embedded Shopify Apps

Shopify Expert
3937 16 325

Two things are facts. A merchant is authenticated and authorized to use the Shopify admin for their shop in a session. Apps also have to authenticate and merchants authorize Apps with oAuth and that creates another session in the App.

A Shopify session lasts for N seconds. An embedded App can have a session last N-1 seconds and thus transition into a state of not logged in. Usually Shopify sends the parameter of in a request to an embedded App so it is easy enough to catch that and authenticate. 

The problem is any non-trivial App using Ajax and an expired session has no way of supplying the shop= parameter for all it's own requests since the App can only get the current shop from a now-expired session variable. There is no method whereby an embedded App can ask the shop "hey, in case I need to know, what shop is this?".

Anyone have a simple solution or hot tip on how to work around this? The merchant is logged in to Shopify, but no longer to the App, so how to re-boot an embedded App session?


Custom Shopify Apps built just for you!