You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
I'm trying to load the session via Shopify.Utils.loadCurrentSession(req, res, true) but after reading the code I noticed it first checks if the request is valid with validateCallback which then checks for the presence of a cookie called shopify_app_session.
When I make a request to the server via the front-end the cookie is not sent because cookies are not allowed in Shopify Apps, thus cookies are empty and fails to load the session object. Of course, if I set a shopify_app_session cookie when the app is first loaded it works as expected, but it will be rejected due to the usage of cookies.
How do we solve this?
What I'm doing right now is returning the session object from the validateCallback callback and then store this somehow e.g. accessToken and session ID in DB and shopOrigin in the client (sessionStorage, etc) for easy access. Is that the correct approach?
The text was updated successfully, but these errors were encountered:
It's cool that I'm able to get the offlineToken, but I still have issues to call loadCurrentSession because it tries to find a shopify_app_session cookie and afaik cookies are not allowed in embedded apps.
I'm trying to load the session via
Shopify.Utils.loadCurrentSession(req, res, true)
but after reading the code I noticed it first checks if the request is valid withvalidateCallback
which then checks for the presence of a cookie calledshopify_app_session
.When I make a request to the server via the front-end the cookie is not sent because cookies are not allowed in Shopify Apps, thus cookies are empty and fails to load the
session
object. Of course, if I set ashopify_app_session
cookie when the app is first loaded it works as expected, but it will be rejected due to the usage of cookies.How do we solve this?
What I'm doing right now is returning the
session
object from the validateCallback callback and then store this somehow e.g. accessToken and session ID in DB and shopOrigin in the client (sessionStorage, etc) for easy access. Is that the correct approach?The text was updated successfully, but these errors were encountered: