多域之间的会话渗透? [英] Session persisitence between multiple domain?

查看:100
本文介绍了多域之间的会话渗透?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在同一台服务器上为多个域进行通用会话,对于我们正在使用session_cookie的子域,我可以为子域进行通用会话。

Is there any way to make common session for multiple domains on the same server, for sub domains we are using session_cookie so i am able to make common session for sub domains.

请帮助!!!

推荐答案

你应该存储数据库中的会话数据,这是通过重新路由保存处理程序到您的数据库保存功能,如下所示:

You should store you session data in the database, this is accomplished by "rerouting" the save handler to your DB saving functions, like this:

session_set_save_handler ( callback $open , callback $close , callback $read , 
                           callback $write , callback $destroy , callback $gc )

回调是显而易见的。如果您在Google中进行快速搜索,您将会发现一堆关于此事的教程,因此您不必从头开始编写。另外,如果要执行自己的会话类,请务必阅读Chriss Shiflett的文章关于会话的真相

The callbacks are obvious. if you make a quick search in Google you'll find a bunch of tutorials on the matter, so you won't have to write it from scratch. Also, if you are going to implement your own session class, be sure to read Chriss Shiflett's article "The Truth about sessions"

这篇关于多域之间的会话渗透?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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