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

XF 1.4 [SOLVED] Loosing session

Discussion in 'Troubleshooting and Problems' started by kankan, Feb 17, 2015.

  1. kankan

    kankan Active Member

    Hello
    Just setup a fresh XF 1.4 and facing this problem :
    i log in.
    when paage has to refresh for any reason, i am loosing my session and have to reconnect.
    Anyway to fix this ?

    Thanks for support.
     
    Last edited: Feb 17, 2015
  2. Tracy Perry

    Tracy Perry Well-Known Member

    Probably due to the fact that you have it available with both the WWW and non WWW site. You need to decide on one or the other and then redirect to that one. You also need to make sure that your URL's in the ACP correspond to whichever one you decide on.... that is, if it's your Asus forum you are asking about. If it's another then you a link would help.

    Screen Shot 2015-02-17 at 5.54.28 PM.png Screen Shot 2015-02-17 at 5.54.42 PM.png
     
  3. kankan

    kankan Active Member

    Hi Tracy
    Thank you for your answer
    I am not sure to understand. where can i check this ?
     
  4. Tracy Perry

    Tracy Perry Well-Known Member

    Depending on your HTTP server, it's controlled via htaccess or the vhost definition.

    What I mean is I can reach your site at
    http://www.forum-des-portables-asus.fr/forums/
    or
    http://forum-des-portables-asus.fr/forums/

    You need to decide if you want the WWW shown or not, and then use the redirect via the htaccess method or if using nginx in the vhost to direct all connections from www to the non-www or vice versa.
     
  5. kankan

    kankan Active Member

    URL in ACP is correct with http://www. and whithout trailing /
     
  6. kankan

    kankan Active Member

    Ok i understand. Will check in that way and let you know.
    Thanks Tracy
     
  7. kankan

    kankan Active Member

  8. Tracy Perry

    Tracy Perry Well-Known Member

    You can very likely have the same problem... as you are serving your site there up at both the WWW and non-WWW. You (on both) need to decide which way you are wanting it served out and modifying the rewrites to work for it.
     
  9. kankan

    kankan Active Member

    Yep, the strange thing is that i have no problem with the other setup :)
    I was more thinking of a cache system somewhere..
    I will check this URL thing, thanks.
     
  10. Mike

    Mike XenForo Developer Staff Member

    If you're running 2 XF installs on the same domain, their cookies will conflict out of the box and that could lead to being logged out. You'd need to change the cookie prefix for one of them via config.php to prevent this.
     
  11. kankan

    kankan Active Member

    Hi Mike
    Thanks for helping.

    Here is the content of my config.php :

    Code:
    <?php
    
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'xxxxx';
    $config['db']['password'] = 'xxxxxx';
    $config['db']['dbname'] = 'forumasus_xen_new';
    //$config['debug'] = true;
    
    $config['superAdmins'] = '1,18971';
    
    //$config['enableListeners'] = false;
    Where do i need to specify the cookie session ?

    Thanks
     
  12. Mike

    Mike XenForo Developer Staff Member

    You can do:
    Code:
    $config['cookie']['prefix'] = 'prefix_';
     
    kankan likes this.
  13. kankan

    kankan Active Member

    Thanks it did the job
     

Share This Page