aibon
12-09-2006, 09:21 AM
hi there,
we recently upgraded to vb3 and moved our forum to a different server. For cosmetic reasons we want the users on our main site to be counted in our forum and as sideefect keep their sessions if they switch form the forum to the mainsite and vice versa. to achieve that we thought about using this little neat trick: on every page on our main site we put a transparaent image that is generated in the forum:
<img src="http://www.forum.com/sessionimage.php?" width="1" height="1">
the code for the sessionimage.php looks like this:
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
define('VB_AREA', 'Forum');
define('NOPMPOPUP', 1);
require_once('./global.php');
header('Content-type: image/png');
$Img = @ImageCreate (1, 1);
$Gray = imagecolorallocate($Img,32,32,32);
imagecolortransparent($Img,$Gray);
imagepng($Img);
imagedestroy($Img);
this should work. but for some reason vbulletin isn't counting that sessions. i suppose there's somewhere a check for referring pages or something like that which prevents vbulletin from generating the session. but i can't find anything. any clue why this isn't working?
cookies are set right, both sites are subdomain, cookiepath . .comain.com. i also checked the settings in admincp for allowing access from diffrent domains. but i doubt that these has anything to do ith the problem.
thx
we recently upgraded to vb3 and moved our forum to a different server. For cosmetic reasons we want the users on our main site to be counted in our forum and as sideefect keep their sessions if they switch form the forum to the mainsite and vice versa. to achieve that we thought about using this little neat trick: on every page on our main site we put a transparaent image that is generated in the forum:
<img src="http://www.forum.com/sessionimage.php?" width="1" height="1">
the code for the sessionimage.php looks like this:
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'index');
define('VB_AREA', 'Forum');
define('NOPMPOPUP', 1);
require_once('./global.php');
header('Content-type: image/png');
$Img = @ImageCreate (1, 1);
$Gray = imagecolorallocate($Img,32,32,32);
imagecolortransparent($Img,$Gray);
imagepng($Img);
imagedestroy($Img);
this should work. but for some reason vbulletin isn't counting that sessions. i suppose there's somewhere a check for referring pages or something like that which prevents vbulletin from generating the session. but i can't find anything. any clue why this isn't working?
cookies are set right, both sites are subdomain, cookiepath . .comain.com. i also checked the settings in admincp for allowing access from diffrent domains. but i doubt that these has anything to do ith the problem.
thx