主屏幕上 iPhone Web 应用程序上的 Google appengine 身份验证
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了这个问题,只是想在这里发布解决方案。
修复方法非常简单,只需设置链接
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.