By default, the session expiration time is around 10 min means if you are inactive on site from the last 10 min it will automatically log out after 10 minutes of inactivity.
If you wish to change it follow the below solution:
Locate the path in your project config -> packages -> framework.yaml
You will basically store the sessions in the /var/sessions/ directory and that's it, the lifetime option will work again. You can do this quickly by modifying your framework.yaml file in the session block like this:
session:
handler_id: session.handler.native_file
save_path:
'%kernel.project_dir%/var/sessions/%kernel.environment%'
#2 Days lifetime (172800 seconds)
cookie_lifetime: 172800
cookie_secure: 'auto'
cookie_samesite: 'lax'
After saving the framework.yaml file you should clear your project cache by the below command:
$ php bin/console c:c
Once you make a try with the given solution, most probably it should works for you.