且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动登录到当前的网站,如果用户登录到另一个网站

更新时间:2023-09-28 18:39:46

从主叫网站,你可以创建一个GUID或一些其他随机生成的价值。其存储在用户记录(设置在一个指定的时间段到期)在数据库中,加密它,并将它传递通过SSL给支付网站,它被解密,然后比较到数据库。如果再搭配用户登录,如果不匹配,那么他们被要求登录。

From the calling site you could create a guid or some other randomly generated value. Store it on the users record (set to expire in a specified time period) in the database, encrypt it and pass it over SSL to the payment site where it is decrypted and then compared to the database. If they match then the user is logged in, if it doesn't match then they are asked to log in.

另一种方式,虽然我不知道它可以与不同的域名使用的会话来完成。因为它们都是在同一台机器上有可能,但我不是100%确定那一个。

Another way although I'm not sure it can be done with different domain names is using sessions. Since they are all on the same machine it might be possible but I'm not 100% sure on that one.