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

Not a Bug automatically being logged-out when clicking on "Home"-button

Discussion in 'Resolved Bug Reports' started by erich37, Oct 12, 2010.

  1. erich37

    erich37 Well-Known Member

    at my XF-website when being logged-in as a user:

    when the user is clicking onto the "Home"-button, the user is automatically being logged-out.

    Same issue happening when clicking onto the logo-image.

    I did not change anything at the settings, just default installed XF-software.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am guessing this is a cookie scope issue. When you click the Home link does the domain portion of the URL change? For example, does one page have "www" and the other not? If the domain portion changes then the cookies are probably going out of scope.

    You can change the Home link in your:

    Admin CP -> Home -> Options -> Basic Board Information -> Home Page URL
    erich37 and Blandt like this.
  3. erich37

    erich37 Well-Known Member

    Hi Jake,

    yes, when the user is logged-in, the domain is without the "www".
    But then when clicking onto the "Home"-Tab, the domain includes the "www".

    I have changed this now in the ACP.

    But I actually want to show the Home-Tab including the "www"
    How to do this ?

    Many thanks,
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    One solution is to simply login from both URLs.

    Otherwise you will need to change your cookie domain in xenForo if you want it to work over your entire domain including all subdomains. The cookie domain needs to be:


    ...using your domain name, including the beginning dot.

    However, xenForo doesn't let you change this in the Admin CP. I think there is a config.php setting for it but I don't know it. Kier or Mike will eventually get to this thread and one of them can probably tell you the setting to add.
    erich37 likes this.
  5. erich37

    erich37 Well-Known Member

    as I removed the "www" at the settings within ACP, as you suggested, the strange thing now is:

    when navigating the Forum, all URLs are having the "www" showing.
    But the "Home"-Tab does not have the "www" within the URL.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The various links on the forum will use the same base URL as the current page. So if you start browsing the forum using "www" then all links will include that. You just need to be consistent with your links and bookmarks. Or login from both URLs. Or change the cookie domain.
  7. Mike

    Mike XenForo Developer Staff Member

    If you ending up on a different sub-domain (domain.com and www.domain.com) being different, then with an out of the box config, this is expected. Generally speaking, you want to be consistent with this anyway. It's significantly better for search engines.

    If you're an advanced user, you can configure the cookie settings via config.php:
    $config['cookie'] = array(
    	'prefix' => 'xf_',
    	'path' => '/',
    	'domain' => '.domain.com'
    I wouldn't recommend doing that unless you know what you're doing though.
    Jake Bunce likes this.
  8. erich37

    erich37 Well-Known Member

    So what should be the format of my domain in the field within ACP ? Or should I leave it blank ?

    "Home Page URL"

    Admin CP -> Home -> Options -> Basic Board Information -> Home Page URL
  9. Brogan

    Brogan XenForo Moderator Staff Member

    That can be whatever you want.
    For example I have this: http://www.mysite.com/pages/home/
  10. erich37

    erich37 Well-Known Member

    ok, I have checked again:

    when being logged in at the domain showing the "www", then entering the domain without the "www" into the browser-line, I am being logged-out automatically again.

    So is this a server-issue or is this an issue with my ACP-settings ?

    If it is a server-issue, what do I need to tell my hosting-provider to change ?

    Many thanks,
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It's just a matter of cookie scope.

    Note that if you change the cookie domain in the config file then you need to logout/login again for the changes to take effect. Sometimes you also need to manually delete your browser cookies to get rid of the old cookie.
  12. erich37

    erich37 Well-Known Member

    I have now contacted my host and they have made a "rewrite" within the ".htaccess" file, which means when someboody enters my URL without the "www", then he will be automatically forwarded to the URL including the "www".

    I am just concerned whether this will be a negative impact for the search-engines ?

    RewriteEngine On > RewriteCond %{HTTP_HOST} !^www.mydomain.com [NC] > RewriteRule ^(.*) http://www.mydomain.com/$1 [R=301,L]

  13. JVCode

    JVCode Well-Known Member

    No, search engines are fine with that. :)
    erich37 likes this.
  14. erich37

    erich37 Well-Known Member

    Many thanks for your help guys !

    The hosting-company said this is an issue coming from the software I am using.......

Share This Page