• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Get Logged Out When Switching Between 2 Boards on Same Domain

Vilandra

Active member
#1
I've set up tests for both my licenses in subforums of a single domain. But if I try to have both sites open at the same time, I get logged out of both almost immediately after logging in. I assume it's some sort of cookie thing, but I can't find where to set that on XF. Anyone able to point me in the right direction? Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
You will need to restrict the cookie scope of each forum by editing their respective library/config.php files. Add this code to each config file:

Code:
$config['cookie'] = array(
	'prefix' => 'xf_',
	'path' => '/path/',
	'domain' => ''
);
For example, if these are the two forum URLs:

http://www.yoursite.com/forum1/
http://www.yoursite.com/forum2/

Then you would use this code:

Code:
$config['cookie'] = array(
	'prefix' => 'xf_',
	'path' => '/forum1/',
	'domain' => ''
);
Code:
$config['cookie'] = array(
	'prefix' => 'xf_',
	'path' => '/forum2/',
	'domain' => ''
);
That will restrict the forum cookies to their respective subdirectories so they don't step on each other.
 

Mike

XenForo developer
Staff member
#5
TBH, just changing the prefix of the cookie can be easier. The path works as well. :) (From a technical standpoint, I do find it easier to debug with different prefixes.)
 
F

Floris

Guest
#6
Or use 2 different browsers like Fire fox & Chrome. I *think* that would also work.
That's not something you can ask your members, and it's not a solution either. But yeah, that will also work.

Jake's solution will work, but all I run on mine is a cookie prefix, one_ two_ three_ four_ etc.