diff --git a/README.markdown b/README.markdown index 42aa060..7c0170e 100644 --- a/README.markdown +++ b/README.markdown @@ -176,6 +176,18 @@ Actually, the following constants can be overrided: - `DEBUG` => default is false (enable logs dump of picoFeed) - `DEBUG_DIRECTORY` => default is /tmp (place to store log files) - `THEME_DIRECTORY` => default is themes +- `SESSION_SAVE_PATH` => default is empty (used to store session files in a custom directory) + +### How to change the session save path ? + +With several shared hosting providers, sessions are cleaned frequently, to avoid to login too often, +you can save sessions in a custom directory. + +- Create a directory, by example `sessions` +- This directory must be writeable by the web server user +- This directory must NOT be accessible from the outside world (add a `.htaccess` if necessary) +- Override the application variable like described above: `define('SESSION_SAVE_PATH', 'sessions');` +- Now, your sessions are saved in the directory `sessions` ### How to create a theme for Miniflux? diff --git a/common.php b/common.php index aee4c6c..de62204 100644 --- a/common.php +++ b/common.php @@ -17,6 +17,7 @@ defined('DB_FILENAME') or define('DB_FILENAME', 'data/db.sqlite'); defined('DEBUG') or define('DEBUG', false); defined('DEBUG_DIRECTORY') or define('DEBUG_DIRECTORY', '/tmp'); defined('THEME_DIRECTORY') or define('THEME_DIRECTORY', 'themes'); +defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', ''); PicoTools\container('db', function() { diff --git a/index.php b/index.php index 628bb07..acfb58e 100644 --- a/index.php +++ b/index.php @@ -16,6 +16,7 @@ use PicoFarad\Session; use PicoTools\Template; +if (SESSION_SAVE_PATH !== '') session_save_path(SESSION_SAVE_PATH); Session\open(dirname($_SERVER['PHP_SELF']));