Cannot initialise database, "You have been logged out, because the session token of your request was incorrect"

Hello,

I have already installed phpList before successfully on another server.

This time, on another server, however, I am unable to do so. When I click on “Initialise Database”, I am redirected to a page with the following error message, “You have been logged out, because the session token of your request was incorrect.” And… that’s it. Nothing more explicit. It happens no matter the computer or the browser I use.

This issue has been barely reported on this forum, but still I have tried everything that was suggested, with no success.

  1. I don’t have Varnish, which I’ve read can cause issues.

  2. I tried to turn Nginx’s sendfile parameter to off, but that changed nothing.

  3. I made sure that session.cookie_secure was set to 0 in php.ini.

  4. I checked how sessions were handled in php.ini. Nothing seemed off, but I’m not an expert, mind you. Here’s my php.ini file.

  5. I have tried to reupload phpList several times.

Do you guys have any suggestions?

Thanks.

@VanillaH The session.save_path looks wrong

session.save_path /opt/remi/php56/root/var/lib/php/session /opt/remi/php56/root/var/lib/php/session

Have you changed that? Try simply /tmp in the php.ini file.

Some simple suggestions; have you:

  1. Cleared private data in your browser / used a private or incognito window? If old session data is saved then it could be conflicting
  2. Checked that the URL you’re using is clean, without &tk=...?
  3. Tried setting $require_login = 0; in lists/config/config.php? While this has been removed in the current development version of phpList, and can cause unwanted side-effects on older versions, it may allow you to use the initialisation wizard without further ado.

@samtuke the problem was that php sessions were not being saved. The web server process did not have write access to the specified directory.

In that case you were already in the right track. Happy to hear it!

I just had the same issue with Amazon Linux . It defaults to use /var/lib/php/5.6/session which seems owned by root
chown -R apache:apache /var/lib/php/5.6/session/
Did the job,
Steve