How to separate PWA session and cookie with a standalone browser? ( PWA as private tab )

拟墨画扇 提交于 2020-03-22 09:14:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!