Hi! I posted this solution in the JFusion forums; I am posting it here as well. I hope it helps.
To fix the login issue, two problems need to be solved: setting cookies and opening sessions. We need to tell Joomla to always use our top domain (and not subdomains) for these operations.
Be sure to replace mysite.com with your actual domain name below.
Fix Sessions:
File to edit:
\libraries\joomla\session\session.php
Find the two occurences of the line:
Add the following code on a new line right before session_start() is invoked:
Code: Select all
ini_set('session.cookie_domain','.mysite.com');
Fix Cookies:
Files to edit:
/libraries/joomla/application/application.php
/libraries/joomla/session/session.php
/plugins/system/remember.php
Find all the occurences of the setcookie(...) function in the files above.
Add an additional (domain) parameter: '.mysite.com'
Examples:
Code: Select all
setcookie(session_name(), '', time()-42000, '/');
transforms into
Code: Select all
setcookie(session_name(), '', time()-42000, '/', '.mysite.com');
Code: Select all
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/' );
transforms into
Code: Select all
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/', '.mysite.com' );
I am aware that this is not the most elegant solution, but it gets the job done. I hope this will help many site owners use the wonderful JFusion extension. Thanks to the JFusion team for bringing us this wonderful piece of software.
Greetings from Macedonia.