Forum Moderators: coopster

Message Too Old, No Replies

Multiple server

         

Majid

9:35 am on Aug 4, 2008 (gmt 0)

10+ Year Member



Hello,

I have a huge website with some sub domains.
we set each sub domains on a separate servers because each sub domain have high pressure on one server.
Now I have a question.
our user accounting system is located on forum.domain.com on a server, now I want to use the cookies and user information on my another sub domain which located on another server for example test.domain.com.
our forum system is vBulletin , I can access to user information when my another sub domain located on forum server with this code :

require_once("global.php");
$userID = $vbulletin->userinfo['userid'];
$userName = $vbulletin->userinfo['username'];

but I want to know how can I do it when that sub domain not located on the server of forum.

Regards,
Majid

janharders

10:24 am on Aug 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you'll have to change the way the cookies are set, they're probably now set with a domain-value of forum.domain.com while they should just have domain.com (so that the browser is instructed to send the cookie on every request to domain.com and it's subdomains). I don't know vbulletin, but you can usually change that value in the administration panel. give it a try, if your tests are not successful, report back and have a look at the http headers your server and client actually send to each other, so you can see wether the problem is the cookie not being sent or the scripts on the server not working properly.

Majid

7:03 am on Aug 28, 2008 (gmt 0)

10+ Year Member



Thanks for your reply,

vbulletin recommended we should use this way to get user information (for security reason).
so, I should include global.php from another server :(

can I do it ?

PHP_Chimp

9:05 am on Aug 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may be able to use include and require with files on other servers i.e. require 'http://code.example.com/global.php';
This may not be allowed by your server for security reasons. This is set with allow_url_fopen [uk3.php.net]