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

XenForo in Dev/Staging/Production Environments

robdog

Well-known member
#1
Has anyone set this up successfully yet?

I am having session issues going from 1 environment to the next. (getting logged out in the admin)
 

Jake Bunce

XenForo moderator
Staff member
#2
Your two forums are probably stepping on each other's cookies. Two options:

1) Install one of the forums on a subdomain. That will separate the cookies.

2) Edit the cookie settings of one of the forums by adding this code to the library/config.php file:

Code:
$config['cookie'] = array(
	'prefix' => 'xf_',
	'path' => '/',
	'domain' => ''
);
It is enough to change the prefix. For example:

Code:
$config['cookie'] = array(
	'prefix' => 'xfdev_',
	'path' => '/',
	'domain' => ''
);
 

robdog

Well-known member
#3
Did this, but I am still getting issues with logging in. :(

I basically deployed everything from my local environment to staging. (files and DB) I was hoping that I didn't have to do a clean install and copy template edits 1 at a time. (at least for the initial installation)

I guess now would be a good time to document what needs to change when moving an install through the development environments. (Within the file structure and database)

Also, the forum is on a subdomain.

Local: local.forums.domain_name.com
Staging: staging.forums.domain_name.com
 

Jake Bunce

XenForo moderator
Staff member
#4
This certainly sounds like a cookie scope problem. Setting a different prefix should prevent conflicts.

Are the two forums online where I can register and try to reproduce the problem?
 

robdog

Well-known member
#5
You will not be able to get access to the local environment, but I can give you access to staging. However, I think the test would not work out as well since you don't get to access both environments.

I will be checking a few additional things out. If it keeps happening, I might do a clean install on staging and export/import just the style and see if that helps.