如何自动登录姊妹网站。 [英] How to login to sister site automatically.

查看:163
本文介绍了如何自动登录姊妹网站。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理两个位于不同域的网站,但两个网站互连并与同一个数据库和CMS通信。现在我希望一旦用户登录到第一个站点,它就会自动登录到第二个站点。考虑到两个域不同(尽管在同一服务器中),实现此目的的最佳方法是什么。是否最好使用curl?

解决方案

不会声称这是最好的方法,但我使用动态创建的链接将用户从一个站点传递到其他 - 这样的链接传递GUID类型(加密)参数,然后我检查目标网站上的有效性,如果好,然后自动登录。 [edit] GUID是用户ID和时间戳的一个集合 - 所以链接不仅必须在第二个站点上验证,而且它也只对导航发生所需的几秒钟有效。

I am working on two sites that are in different domain but both are interconnected and talking to same database and CMS. Now I want once user logs in to 1st site, it should automatically login to 2nd site. What will be the best way to achieve this considering both the domains are different(though in same server). Is it best to use curl ?

解决方案

Won't claim this is the best way, but I've used dynamically created links to pass users from one site to the other - such links passing a GUID-type (encrypted) paramater which I then check on the destination site for validity, and if good then logging them in automatically. [edit] The GUID is an ecrypted conglomerate of the user ID and a timestamp - so the link must not only be validated on the second site, but it is also only valid for the few seconds needed for the navigation to take place.


这篇关于如何自动登录姊妹网站。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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