From 8474ef8be293eb15bd23abd70dd740a600ca1c50 Mon Sep 17 00:00:00 2001 From: alext Date: Sun, 13 Nov 2016 12:25:02 +0100 Subject: [PATCH] PHP sessions will be stored in the "storage" directory (fixes #241) (cherry picked from commit 557c282) --- .gitignore | 19 +++++++++++-------- gulpfile.js | 21 +++++++++++++++++++-- src/application/config/config.php | 4 ++-- src/storage/sessions/.htaccess | 1 + src/storage/sessions/index.html | 10 ++++++++++ 5 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 src/storage/sessions/.htaccess create mode 100644 src/storage/sessions/index.html diff --git a/.gitignore b/.gitignore index 501d9c4f..1032cd58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,20 @@ -.idea -.tmp-package -composer -easyappointments.zip -node_modules +.idea/ +.tmp-package/ +composer/ +*.zip +node_modules/ npm-debug.log src/storage/cache/* !src/storage/cache/.htaccess !src/storage/cache/index.html src/storage/logs/* !src/storage/logs/index.html +src/storage/sessions/* +!src/storage/sessions/.htaccess +!src/storage/sessions/index.html src/storage/uploads/* !src/storage/uploads/index.html src/config.php -doc/apigen -doc/jsdoc -doc/plato +doc/apigen/ +doc/jsdoc/ +doc/plato/ diff --git a/gulpfile.js b/gulpfile.js index 18cb6deb..f6a27c69 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,8 +51,25 @@ gulp.task('build', function(done) { fs.copySync('LICENSE', '.tmp-package/LICENSE'); del.sync([ - '.tmp-package/application/logs/*', - '!.tmp-package/application/logs/index.html' + '.tmp-package/storage/uploads/*', + '!.tmp-package/storage/uploads/index.html' + ]); + + del.sync([ + '.tmp-package/storage/logs/*', + '!.tmp-package/storage/logs/index.html' + ]); + + del.sync([ + '.tmp-package/storage/sessions/*', + '!.tmp-package/storage/sessions/.htaccess', + '!.tmp-package/storage/sessions/index.html' + ]); + + del.sync([ + '.tmp-package/storage/cache/*', + '!.tmp-package/storage/cache/.htaccess', + '!.tmp-package/storage/cache/index.html' ]); zip('.tmp-package', { saveTo: 'easyappointments.zip' }, function (err, buffer) { diff --git a/src/application/config/config.php b/src/application/config/config.php index efd2c63e..ab7ce035 100644 --- a/src/application/config/config.php +++ b/src/application/config/config.php @@ -292,9 +292,9 @@ $config['encryption_key'] = Config::BASE_URL; | */ $config['sess_driver'] = 'files'; -$config['sess_cookie_name'] = 'ci_session'; +$config['sess_cookie_name'] = 'ea_session'; $config['sess_expiration'] = 7200; -$config['sess_save_path'] = NULL; +$config['sess_save_path'] = __DIR__ . '/../../storage/sessions'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; diff --git a/src/storage/sessions/.htaccess b/src/storage/sessions/.htaccess new file mode 100644 index 00000000..3418e55a --- /dev/null +++ b/src/storage/sessions/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/src/storage/sessions/index.html b/src/storage/sessions/index.html new file mode 100644 index 00000000..c942a79c --- /dev/null +++ b/src/storage/sessions/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + \ No newline at end of file