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

Test Forums Interfere With Live Forums

Discussion in 'Troubleshooting and Problems' started by Dodgeboard, Nov 23, 2011.

  1. Dodgeboard

    Dodgeboard Well-Known Member

    This is something that I've been seeing for awhile. I'm not sure if I have something misconfigured or what I could be doing wrong.

    My live forums are located at www.dodgeboard.com/forums
    My test forums are located at www.dodgeboard.com/testforums (protected by htaccess)

    Both have their own files and separate databases!

    If I login to my testforums, and make any change at all (or even an upgrade of my testforums), my URLS become confused on my LIVE forums. All of my registration emails start going out with www.dodgeboard.com/testforums in the URL and when I look in the admincp of the LIVE forums, the URL has changed in some places, but not all. The contact URL changes and the Privacy URL changes but not the BOARD URL. It stays as it should.

    Screenshot of my live board after upgrading my testforums:



    err.jpg

    I know this seems weird.

    All I have to do to fix it is change the board URL (to anything) then hit save. Then change it back. Then the URLS correct themselves as follows:

    corr.jpg



    My testforums (FROM MY TESTFORUMS ADMINCP) settings look to be correct:


    testforums.jpg


    What could I be missing? Why do these forums in two totally separate directories/databases seem to be intertwined? Now, out of habit, whenever I even visit admincp at my testforums, I always login to my live board to make everything the URLS are OK and to fix them if necessary.

    Any help would be appreciated?
     

    Attached Files:

    • err.jpg
      err.jpg
      File size:
      59.4 KB
      Views:
      2
  2. ChemicalKicks

    ChemicalKicks Well-Known Member

    I've noticed I cannot log into my test forum without being logged out of my live forums. When I first attempt to log back into live my password is always rejected as wrong, enter it a second time and it magically works. So you're not the only one.

    Perhaps in your case you've misconfigured something in htaccess?
     
  3. Dodgeboard

    Dodgeboard Well-Known Member

    I wondered about that. And I have the same issue as you have mentioned...getting logged out of both when logging out of one.

    My htaccess in my testforums directory is "stock". However, the one at the root level is forwarding traffic to my forums directory:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^dodgeboard.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.dodgeboard.com$
    RewriteRule ^/?$ "http\:\/\/www\.dodgeboard\.com\/forums\/index\.php" [R=301,L]

    I wouldn't think anything there would conflict or cause this problem.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Seems an odd issue but it could possibly be related to cache and/or cookies.
     
  5. mcrider

    mcrider Member

    Just checked and I have the same issue, could the problem be that there is no customizable cookie path for multiple forum installations?
     
  6. Floris

    Floris Guest

    Does your config.php have a cookie set for both sites,
    and if you use apc caching, do you use a prefix for both sites?
     
    Dodgeboard and mcrider like this.
  7. Kevin

    Kevin Well-Known Member

    Check this post and follow the changes Jake posted to change your cookie prefix...

    http://xenforo.com/community/threads/xenforos-handing-of-cookie-domains.15260/

    Also, if you're running APC or other cache, as Floris mentioned make sure you also have specified a per site cache prefix as well.
     
    Dodgeboard and mcrider like this.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I agree with Floris about the cache thing. If you are using a memory cache they must be separate.

    Regarding the login problem... with the default cookie settings that problem is normal. Three solutions are:

    1) Setup a subdomain for your test forum and install it there. That will avoid cookie conflicts with the default settings.

    2) Specify different cookie paths for each forum. Refer to this thread:

    http://xenforo.com/community/threads/xenforos-handing-of-cookie-domains.15260/

    In your case the settings would be:

    Code:
    $config['cookie'] = array(
    	'prefix' => 'xf_',
    	'path' => '/forums/',
    	'domain' => ''
    );
    
    Code:
    $config['cookie'] = array(
    	'prefix' => 'xf_',
    	'path' => '/testforums/',
    	'domain' => ''
    );
    
    3) Specify different cookie prefixes for each forum. The prefix is arbitrary, but they must be different for each forum to avoid conflicts:

    Code:
    $config['cookie'] = array(
    	'prefix' => 'xfforums_',
    	'path' => '/',
    	'domain' => ''
    );
    
    Code:
    $config['cookie'] = array(
    	'prefix' => 'xftestforums_',
    	'path' => '/',
    	'domain' => ''
    );
    
     
    Dodgeboard likes this.
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The rules in your /testforums directory should override those from the web root. You can try temporarily removing those rules to see if they are the cause, but they shouldn't be.
     
  10. Dodgeboard

    Dodgeboard Well-Known Member


    I tried method 2, 3, and (both) 2+3 and I still have the same problem. I do have file caching enabled as Kevin mentioned, but it's not APC, since I am on a shared host. I have this in the config.php of both forums:

    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
    'caching' => true,
    'automatic_serialization' => true,
    'lifetime' => 3600,
    'cache_id_prefix' => 'xf_'
    );
    $config['cache']['backend'] = 'File';

    Could this be the problem? Should I turn it OFF for both or just the testforums?

    EDIT...I think i see the problem now...cache_id_prefix. Testing my theory...
     
  11. Dodgeboard

    Dodgeboard Well-Known Member

    Yep...You guys steered me in the right direction. Jake's idea fixed my login/logout issues. Changing the cache_id_prefix for the testforums seems to have cut the umbilical cord between the two forums. Thanks to Jake, Kevin and Floris for leading me in the right direction. Seems to work like a charm now. Now the only problem I am having is getting logged out of my live board. After changing the cookie prefix, me (and probably all other members) are stuck "logged in". Clicking on "log out" does nothing. I suspect I will have to tell everyone to clear their cookies. Is there a better way?
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Also, here is a full list of configurable options for the file cache:

    http://framework.zend.com/manual/en/zend.cache.backends.html#zend.cache.backends.file

    That means multiple existing login cookies are in scope as a result of the cookie confusion between the two forums. Telling your users to manually clear their cookies is one option. Changing the cookie prefix should have avoided this. A new cookie prefix will result in the forum not seeing any of the old cookies.
     
    Dodgeboard likes this.
  13. Dodgeboard

    Dodgeboard Well-Known Member

  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. It's just useful information if you wish to further configure your file cache.
     
    Dodgeboard likes this.
  15. Dodgeboard

    Dodgeboard Well-Known Member

    Looked at it. It's Greek to me. Thought you were saying I needed to add some options.

    As always, Thanks Jake for all your help. You are a HUGE asset to the community.
     
    ChemicalKicks likes this.
  16. Floris

    Floris Guest

    Glad to hear that's the reason. Unique cookie and cache id for each site, is what I always do, keep them short and simple though. NO weird chars, I even avoid numbers.
     
    Dodgeboard likes this.

Share This Page