Add the possibility to change the session save path

This commit is contained in:
Frederic Guillot 2013-07-23 18:26:53 -04:00
parent 00823c90d6
commit f21f2c1951
3 changed files with 14 additions and 0 deletions

View File

@ -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?

View File

@ -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() {

View File

@ -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']));