Login to both CakePHP and vbulletin
I'm looking to get a single sign on set-up between a cakePHP (1.3) app and a vBulletin (4.0.2) forum.
I've managed to get so far with it, i.e I've been able to get开发者_高级运维 Auth to use the vB user table to let people login, and that works pretty well - the issue now is getting the two different systems to share a session so that users can pass between the main cake site, and the vB forum, without losing their session and being logged out.
Can anyone help point me in the right direction? Thank you.
- Make sure your CakePHP app uses the same session cookie name as vBulletin. You can change this in
app/Config/core.php
under theSession.cookie
key. - It has to be as the
session_name()
in vBulletin uses
If this is done, you have the same data in the global $_SESSION
variable in both systems. You also have to make sure they run under the same top-level domain, so cookies can be read. Also, the cookie has to be a wildcard one, meaning that the session.cookie_domain
has to start with a ".".
For example: .your-domain.com
will allow cakephp.your-domain.com
and forum.your-domain.com
to access the same session cookie.
精彩评论