Facing Error "Security token has expired, so action has been canceled. Please try again" on fresh install version 16.0.4

Hi ,
I have fresh installed dolibarr version 16.0.4 on centos 7 machine.
I have used nginx for webserver.
Following are the details of specification.
Mysql Version 8.0.32
Php 8.0.27
No external module is installed.
While login into dolibarr facing error “Security token has expired, so action has been canceled. Please try again”
I have tried deleting browser cache and cookie issue is not resolved.
Can anyone help me with this error?

Hello,

Check that PHP session configuration is OK.
Have a look on nginx logs ?

Hi, Thank you for your response.
I have checked nginx logs error is.

Error

2023/03/06 16:14:22 [error] 28883#0: *13 FastCGI sent in stderr: “PHP message: PHP Warning: session_start(): open(/var/lib/php/session/sess_o2urfihodg1g36sofp4jgr8ft0, O_RDWR) failed: Permission denied (13) in /home/dolibarr/htdocs/main.inc.php on line 337PHP message: PHP Stack trace:PHP message: PHP 1. {main}() /home/dolibarr/htdocs/index.php:0PHP message: PHP 2. require() /home/dolibarr/htdocs/index.php:31PHP message: PHP 3. session_start() /home/dolibarr/htdocs/main.inc.php:337PHP message: PHP Warning: session_start(): Failed to read session data: files (path: /var/lib/php/session) in /home/dolibarr/htdocs/main.inc.php on line 337PHP message: PHP Stack trace:PHP message: PHP 1. {main}() /home/dolibarr/htdocs/index.php:0PHP message: PHP 2. require() /home/dolibarr/htdocs/index.php:31PHP message: PHP 3. session_start() /home/dolibarr/htdocs/main.inc.php:337” while reading response header from upstream, client: 192.168.0.57, server: _, request: “POST /index.php?mainmenu=home HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/php-fpm.sock:”, host: “192.168.1.84:8086”, referrer:

Hello,

You have the answer on the logs :

PHP is not able to create files on /var/lib/php/session

Have a look on permissions.

Thank you for Help
I changed the /var/lib/php/session/ group to nginx.
Command:-
chown root:nginx -R /var/lib/php/session
That solved my issue.
:smile:

1 Like