0
votes

I have built a webapp that renders different content for a given route based on whether a user is authenticated or not (by simply checking if req.user is defined).

Additionally, I am using <meta name="apple-mobile-web-app-capable" content="yes" /> to allow iOS users to open the app in fullscreen mode straight from their homepage.

Although accessing the route in question on traditional browsers (both web and mobile Safari and Chrome) displays the correct content, accessing the webapp in fullscreen mode does not. Further investigation led me to realise that req.user is undefined in the latter case.

The issue presumably lies with the fullscreen app mode not properly persisting the user's browser session. As such, what would be the best fix/workaround?

Any advice would be greatly appreciated!

1
This answer might be helpful, assuming the behavior still works: stackoverflow.com/questions/9998900/…barry-johnson

1 Answers

0
votes

Solved!

Rather than fiddling with sessions outright, I opted to simply re-authenticate within the web-app view. To do this, I needed a way for links to open within the view itself rather than in Safari; this gist came in handy.

The session now persists upon closing/reopening the app as well when the app page is closed from within the task manager and subsequently reopened. Problem solved!