Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/functions/session_proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public static function init(): void
self::migrateLegacySessionIfNeeded($store);

// Start PHP session with cookies disabled (Laravel owns the cookie).
if (session_status() === PHP_SESSION_NONE) {
// Skipped on CLI: there are no headers to send there, and the merge
// below fills $_SESSION either way. The CLI installer reaches this
// after it has printed, so each call would only warn.
if (PHP_SAPI !== 'cli' && session_status() === PHP_SESSION_NONE) {
ini_set('session.use_cookies', '0');
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80400) {
ini_set('session.use_only_cookies', '0');
Expand Down
4 changes: 3 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
if (IN_INSTALL_MODE) {
// Set some settings, and address some IE issues.
@ini_set('url_rewriter.tags', '');
if (session_status() === PHP_SESSION_NONE) {
// Browser-only session tweaks. The CLI installer includes this file after
// it has already printed, so on CLI these only warn about sent headers.
if (PHP_SAPI !== 'cli' && session_status() === PHP_SESSION_NONE) {
ini_set('session.use_trans_sid', 0);
ini_set('session.use_only_cookies', 1);
}
Expand Down