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

XF 1.2 constantly logged out of admin

Discussion in 'Troubleshooting and Problems' started by jdeg, Aug 15, 2013.

  1. jdeg

    jdeg Active Member

    The timeout on the admin panel seems incredibly short. I've been getting logged out within seconds, even between running tasks like resetting caches, installing addons, and sending emails. I am using xcache as a datastore cacher and have debug mode enabled. Any ideas?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Are you behind a Cloud-flare like service?
     
  3. jdeg

    jdeg Active Member

    nope - I am using a cdn for static files though.
     
  4. RoldanLT

    RoldanLT Well-Known Member

    Are you using this on your /library/config.php ?
    Code:
    $config['cache']['cacheSessions'] = true;
     
  5. Miguel Dias

    Miguel Dias Member


    While digging into the same problem I found this thread.

    I actually getting out from admincp and I have that line of code...

    Any suggestions?
     
  6. RoldanLT

    RoldanLT Well-Known Member

    Remove it.
     
    Miguel Dias likes this.
  7. Miguel Dias

    Miguel Dias Member

    Done and tested without issues now!
     
  8. zagman76

    zagman76 Member

    I am also having this problem, and I recently put my sever behind an AWS ELB.

    I tried commenting out the $config['cache'] line, but am still being logged out constantly.
     
  9. Mike

    Mike XenForo Developer Staff Member

    If the IP shown in PHP info (admin.php?tools/phpinfo, if you can access that) in the "REMOTE_ADDR" value is not your IP, you need to look for your IP and set it to $_SERVER['REMOTE_ADDR'] in config.php.
     
  10. zagman76

    zagman76 Member

    Hi Mike - in my phpinfo, that IP is not my actual IP - it appears to be a 10.0.0.0/8 IP, within AWS. In my config.php file, do I just add a line that says:
    Code:
    $_SERVER['REMOTE_ADDR'] = 10.x.y.z;
    or do I put my actual ip instead of the 10.0.0.0/8 one? Also, do I have to do this every time my ISP changes my IP, or if I need to access the adminCP when not at home?
     
  11. Mike

    Mike XenForo Developer Staff Member

    You need to find which value in $_SERVER has your real IP and use something like:

    Code:
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
    Replace the HTTP_X_FORWARDED_FOR with the correct value (it varies by setup).
     

Share This Page