Markup Chooser causes user logout

zshaw
13 years, 7 months ago
Just wondering if anyone else had the problem of being logged out of joomla when the markup is changed? for example, from iphone to standard.
I am not sure why, but if I log in, then go to the standard view, it takes me to the login page, and I must login to continue.

Any ideas?
dryabov
13 years, 7 months ago
Do you use subdomain for mobile version?
zshaw
13 years, 7 months ago
Yes, MobileJoomla is installed on a subdomain. ie "brand.domain.com"
dryabov
13 years, 7 months ago
Then you should use cross-domain cookies in setcookie() function. In Joomla!1.6 it can be changed in global settings, but in Joomla!1.5 it requires few patches:

1. In libraries/joomla/application/application.php replace (here domain.com is name of your 2nd-level domain; note dot before the name):
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), $rcookie, $lifetime, '/' );

by
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), $rcookie, $lifetime, '/', '.domain.com' );

and
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/' );

by
setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/', '.domain.com' );


2. In libraries/joomla/session/session.php replace:
setcookie(session_name(), '', time()-42000, '/');

by
setcookie(session_name(), '', time()-42000, '/', '.domain.com');
zshaw
13 years, 7 months ago
Thanks, I will give that a try!

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.