如何跨域共享Firebase简单登录会话? [英] How do I share Firebase Simple Login sessions across domains?

查看:140
本文介绍了如何跨域共享Firebase简单登录会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有example.com和app.example.com。如何从一个域登录某个用户并与另一个用户共享该会话?使用LocalStorage保存Firebase简单登录会话 或SessionStorage,它们的作用域是HTML5起源,它是方案,主机和端口的元组,这就是为什么默认情况下不在子域之间共享的原因。 ,你可以通过创建一个共享的LocalStorage系统来手动在你的应用程序中启用这个功能,使用如下所述的方法: HTML5数据库和localStorage可以在子域之间共享吗?


I have example.com and app.example.com. How can I log someone in from one domain and share that session with the other?

解决方案

Firebase Simple Login sessions are persisted using LocalStorage or SessionStorage which are scoped to HTML5 origin, which is a tuple of scheme, host, and port, which is why it is not shared across subdomains by default.

That said, you can manually enable this in your application by creating a shared LocalStorage system, using methods like described here at Can HTML5 databases and localStorage be shared across subdomains?.

这篇关于如何跨域共享Firebase简单登录会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆