Xenforo session issue (Using EC2 + load balancer)

klikeras

New member
Hello,

I had an issue with users being constantly logged out of the forum. Somewhere on the forum i found the following and that seems to have fixed it:

Add this to src/config.php:

$_SERVER['REMOTE_ADDR'] = $_SERVER['172.30.3.96'];

After I added that, the sessions were fixed but now every few seconds I'm getting this error in server log:

-----------------------------------------

Server error log
  • ErrorException: [E_NOTICE] Undefined index: 172.30.3.96
  • src/config.php:4
  • Generated by: Unknown account
  • Apr 12, 2018 at 6:55 PM
Stack trace
#0 src/config.php(4): XF::handlePhpError(8, 'Undefined index...', '/var/www/html/f...', 4, Array)
#1 src/XF/App.php(142): require('/var/www/html/f...')
#2 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/App.php(2718): XF\Container->offsetGet('config')
#4 src/XF/App.php(1476): XF\App->container('config')
#5 src/XF/Admin/App.php(40): XF\App->setup(Array)
#6 src/XF.php(312): XF\Admin\App->setup(Array)
#7 src/XF.php(324): XF::setupApp('XF\\Admin\\App')
#8 admin.php(13): XF::runApp('XF\\Admin\\App')
#9 {main}
Request state
array(4) {
["url"] => string(36) "/forum/admin.php?logs/server-errors/"
["referrer"] => string(49) "https://watchersforum.com/forum/admin.php?phpinfo"
["_GET"] => array(1) {
["logs/server-errors/"] => string(0) ""
}
["_POST"] => array(0) {
}
}

-----------------------------------------

Using EC2 amazon linux + apache
Using Amember integration for user registration
Using Xenoforo 2


Anyone have an idea how to fix this?

Thanks!
 
Back
Top Bottom