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

XF 1.3 Cookie issue

Discussion in 'XenForo Questions and Support' started by RustyDogma, Jun 18, 2014.

  1. RustyDogma

    RustyDogma Member

    My site can be accessed with or without www prefix, but it doesn't share cookies between the two so you can be logged into one and not the other. Which can be annoying when both formats are used in links. How do I fix this within Xenforo?
     
  2. Martok

    Martok Well-Known Member

    It's detailed in the Frequently Asked Questions thread.

     
  3. Adam Howard

    Adam Howard Well-Known Member

    I've experienced this issue before myself. Was always looking for away to resolve it without forcing www or non-www.
     
    RustyDogma likes this.
  4. RustyDogma

    RustyDogma Member

    Thanks ! I saw the FAQ, but I was wondering if it could be done like this:

    Code:
    if ($_SERVER['HTTP_HOST'] == 'www.mysite.ws') {
    $config['cookie'] = array(
    'prefix' => 'new_',
    'path' => '/',
    'domain' => '.mysite.ws'
    );
    }
    
    if ($_SERVER['HTTP_HOST'] == 'mysite.ws') {
    $config['cookie'] = array(
    'prefix' => 'new_',
    'path' => '/',
    'domain' => 'mysite.ws'
    );
    }
    But is it better to do it in .htaccess? I want to force a cookie reset at the same time, but was actually hoping to be able to use both www and non-www - but perhaps that cannot work.
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Erik P., RustyDogma and Adam Howard like this.

Share This Page