Skip to content

Commit

Permalink
Tweaked startSession in BaseController to call session_name to set th…
Browse files Browse the repository at this point in the history
…e name of the session if a name option was specified in the session option
  • Loading branch information
rotimi committed Jul 24, 2024
1 parent 91e772a commit 2b9d768
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ protected function startSession(): void {
$this->getAppSetting('session_start_options') !== null
? (array)$this->getAppSetting('session_start_options')
: [];

if(isset($session_start_settings['name'])) {

session_name($session_start_settings['name']);

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.3 - prefer-stable - ubuntu-20.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.3 - prefer-stable - ubuntu-22.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.2 - prefer-stable - ubuntu-20.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.2 - prefer-stable - ubuntu-22.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.1 - prefer-stable - ubuntu-20.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)

Check failure on line 258 in src/controllers/BaseController.php

View workflow job for this annotation

GitHub Actions / PHP-8.1 - prefer-stable - ubuntu-22.04

MixedArgument

src/controllers/BaseController.php:258:26: MixedArgument: Argument 1 of session_name cannot be mixed, expecting null|string (see https://psalm.dev/030)
}

session_start($session_start_settings);
}

Expand Down

0 comments on commit 2b9d768

Please sign in to comment.