<?php
...
$sugar_config = array (
...
'session_dir' => '/<path-to-your-suite8-project>/var/sessions',
'session_gc' =>
array (
'enable' => true,
'gc_probability' => 1,
'gc_divisor' => 100,
),
It is possible to update the global session dir by changing php’s https://www.php.net/manual/en/session.configuration.php#ini.session.save-path directive on your php.ini file.
This only applies to file based sessions
This guide explains how to configure SuiteCRM 8.x versions to store the sessions on a different folder
On public/legacy/config.php
or public/legacy/config_override.php
change the session_dir
to the new path.
Through the rest of this guide we are going to assume that we want to have our session files being stored in a var/sessions
folder within your SuiteCRM 8 instance folder, like:
* /<path-to-your-project>/var/sessions
<?php
...
$sugar_config = array (
...
'session_dir' => '/<path-to-your-suite8-project>/var/sessions',
'session_gc' =>
array (
'enable' => true,
'gc_probability' => 1,
'gc_divisor' => 100,
),
Now we need to change the SuiteCRM 8 symfony configuration.
To add it to SuiteCRM 8 configuration in an extensible way you can add it to:
extensions/<your-extension>/config/services/framework.yaml
If you name your extension custom
it would look something like.
extensions/custom/config/services/framework.yaml
framework:
session:
cookie_lifetime: null
cookie_secure: auto
cookie_samesite: lax
gc_probability : 1
gc_divisor : 100
handler_id: session.handler.native_file
save_path: '%kernel.project_dir%/var/sessions'
From your instance root folder run bin/console cache:clear
bin/console cache:clear
If you don’t have access to the terminal you can also delete the contents of: /<path-to-your-project>/cache
Please make sure that apache / php
have access to write to the cache
folder
The above is not the legacy cache folder. Do not delete the /<path-to-your-project>/public/legacy/cache
Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.