问题
I'm working on a PWA in conjunction with an enterprise application server.
The application server serves a responsive web view for a standalone browser, and customize the view on PWA with the help of PWA cookie which is set on PWA start url for the first time.
The problem is that the session between PWA and a standalone browser ( e.g Chrome on Android ) is being shared and once the user has installed the PWA, the consequent visits to the site with the standalone browser will show the PWA customized view.
Is there any way to separate sessions in PWA and standalone browser in device?I.e. to treat PWA as a private tab?
Or any other way?
回答1:
I am in a similar situation and believe the solution is to differentiate the names of your cookies and/or sessions. So for example - my logged in user has a SESSION['Key']
but for my App I'll have to create one SESSION['AppKey']
. It will (as in my case) require a bit of reworking of your code but I don't believe there is any alternative.
It is worth noting though that IOS appears to separate Cookies from the browser and PWA so you may find testing your scenario with an IOS based device may work as you expect.
来源:https://stackoverflow.com/questions/57231038/how-to-separate-pwa-session-and-cookie-with-a-standalone-browser-pwa-as-priva