主屏幕上 iPhone Web 应用程序上的 Google appengine 身份验证

发布于 2024-08-28 17:38:54 字数 521 浏览 4 评论 0原文

我正在使用 Google appengine 开发一个可在浏览器和 iPhone 上使用的 Web 应用程序。我已经为此应用程序购买了域名,这样我就有了一个漂亮的 URL。我使用用户 API 进行身份验证。这在桌面浏览器和 iPhone Safari 上运行得很好。

用户可以将应用程序添加到主屏幕(通过点击底部工具栏上的“+”)。然而,完成后,Google 设置的 cookie 似乎在此“应用程序”中无效,并且用户实际上已注销。更糟糕的是,当用户单击登录链接(由 GAE 生成)时,应用程序将关闭并打开 safari 以完成登录。由于会话显然不在两者之间共享,因此登录过程是徒劳的,并且应用程序的“主屏幕”版本继续注销。

看来“主屏幕”应用程序和 Safari 之间不共享 cookie。似乎“主屏幕”应用程序只能在其自己的域中运行,任何重定向到任何其他域都会打开 Safari。知道我该如何解决这个问题吗?

I'm using Google appengine for developing an web application that is meant to be used on both the browser and iphone. I have purchased a domain name for this application, so that I have a pretty URL. I've used the User API for authentication. This works just fine on desktop browsers and iPhone Safari.

The user could add the application to the home screen (by tapping the "+" at the bottom toolbar). However when that's done, it seems like the cookies set by Google are not in effect within this "application", and the user is effectively logged out. To make matters worse, when the user clicks on the login link (as generated by GAE), the app closes and opens safari to complete the login. Since the session is apparently not shared between the two, the login process is futile, and the "home-screen" version of the app continues to be logged out.

It seems that the cookies are not shared between a "home-screen" app and Safari. It also seems that the "home-screen" app will only work within it's own domain, and any redirect to any other domain will open Safari. Any idea how I can go about fixing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余生一个溪 2024-09-04 17:38:54

解决了这个问题,只是想在这里发布解决方案。

修复方法非常简单,只需设置链接 href="javascript:window.location.href=\"whatever\";" 即可。

最奇怪的是!不知道为什么我要被迫使用 JS 来实现这一点。

Solved this, and just wanted to post the solution here.

The fix was as simple as setting the link href="javascript:window.location.href=\"whatever\";".

The weirdest thing! No idea why I'd be forced to use JS for this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文