diff --git a/cp/bootstrap/app.php b/cp/bootstrap/app.php index a5a9a67..8043d15 100644 --- a/cp/bootstrap/app.php +++ b/cp/bootstrap/app.php @@ -12,9 +12,17 @@ use Gettext\Loader\PoLoader; use Gettext\Translations; use Punic\Language; -if (session_status() == PHP_SESSION_NONE) { - session_start(); -} +// Enable for debug +// if (session_status() == PHP_SESSION_NONE) { +// session_start(); +// } + +ini_set('session.cookie_secure', '1'); +ini_set('session.cookie_httponly', '1'); +ini_set('session.cookie_samesite', 'Strict'); +ini_set('session.cookie_lifetime', '0'); +ini_set('session.hash_function', 'sha256'); +ini_set('session.entropy_length', '32'); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/helper.php'; diff --git a/docs/install.md b/docs/install.md index 11018fb..106b2f6 100644 --- a/docs/install.md +++ b/docs/install.md @@ -314,6 +314,27 @@ To get the starting list of TLDs (Top-Level Domains) from ICANN and cache it for php /var/www/cp/bin/file_cache.php ``` +### Setting Up Redis Session Storage: + +To utilize Redis for session storage, you need to install the necessary packages and configure your environment accordingly. Follow these steps to set up Redis session storage: + +```bash +cd /var/www/cp +composer require predis/predis pinga/session-redis +``` + +After installation, log out of your application if you are currently logged in. This ensures that the session starts afresh with the new configuration. + +Clear your browser cookies related to the application. This step is crucial as it removes any existing session cookies that were set using the previous session storage mechanism. + +Upon your next login, Redis will be used for storing session data. The new sessions will be created and managed through Redis, providing a more scalable and efficient session management system. + +**Note**: Ensure that your Redis server is properly configured and running before proceeding with these steps. If in doubt, check with: + +```bash +systemctl status redis-server +``` + ## 8. Setup Web Lookup: ```bash diff --git a/docs/install.sh b/docs/install.sh index 106da2f..8b246d7 100644 --- a/docs/install.sh +++ b/docs/install.sh @@ -398,6 +398,9 @@ EOF sed -i "s|\$newPW = 'admin_password';|\$newPW = '$PANEL_PASSWORD';|g" /var/www/cp/bin/create_admin_user.php php /var/www/cp/bin/create_admin_user.php + echo "Downloading initial data." + php /var/www/cp/bin/file_cache.php + echo -e "Installation complete!\n" echo -e "Next steps:\n" echo -e "1. Configure each component by editing their respective configuration files."