Skip to content

Commit

Permalink
Issue #3443948 by n.ghunaim: Add an auto config for the maximum cooki…
Browse files Browse the repository at this point in the history
…e services with Drupal scaffolding for the Persistent Login
  • Loading branch information
Noor Ghunaim authored and Natshah committed Apr 30, 2024
1 parent 014c62f commit 166d420
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ public static function postDrupalScaffoldProcedure(Event $event) {
// services.
copy($drupal_root . '/profiles/contrib/varbase/src/assets/development.services.yml', $drupal_root . '/sites/development.services.yml');
}

if ($fs->exists($drupal_root . '/sites/default/services.yml')) {
// Alter services.yml to have cookie_lifetime 0
$services_path = $drupal_root . '/sites/default/services.yml';
$services_lines = file($services_path);
$services_lines = preg_replace('/cookie_lifetime: \d+/', 'cookie_lifetime: 0', $services_lines);
file_put_contents($services_path, $services_lines);
}
}

/**
Expand Down

0 comments on commit 166d420

Please sign in to comment.