Skip to content
Merged
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
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,10 @@ Previously, in PHP 8, values like `'0'` or `'false'` could be incorrectly interp

Now, default values are accurately converted to `TRUE` or `FALSE` based on their literal meaning.

Berikut adalah versi yang sudah diperbarui untuk catatan rilis MagicObject v3.16.0:

## MagicObject Version 3.15.0

## MagicObject Version 3.16.0

### Features

Expand All @@ -1097,3 +1099,12 @@ Added a new method `deleteRecordByPrimaryKey($primaryKeyValue)` to allow deletin

This method ensures the database connection is active and delegates deletion to the persistence layer.


### Bug Fixes

#### Fix: Session Handling with Redis

Resolved a compatibility issue when using Redis as the PHP session handler. Previously, sessions could fail to initialize or persist correctly under certain configurations.

Now, session storage works reliably with `session.save_handler = redis`, ensuring better support for scalable session storage backends.

15 changes: 11 additions & 4 deletions src/Session/PicoSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ public function __construct($sessConf = null)
$this->setSessionMaxLifeTime($sessConf->getMaxLifeTime());
}
if ($sessConf && $sessConf->getSaveHandler() == "redis") {
$path = $sessConf->getSaveHandler();
$parsed = parse_url($path);
parse_str($parsed['query'], $parsedStr);
$this->saveToRedis($parsed['host'], $parsed['port'], $parsedStr['auth']);
$path = $sessConf->getSavePath();
$parsed = parse_url($path);
$host = isset($parsed['host']) ? $parsed['host'] : '';
$port = isset($parsed['port']) ? $parsed['port'] : 0;
$auth = null;
if(isset($parsed['query']))
{
parse_str($parsed['query'], $parsedStr);
$auth = isset($parsedStr['auth']) ? $parsedStr['auth'] : null;
}
$this->saveToRedis($host, $port, $auth);
} elseif ($sessConf && $sessConf->getSaveHandler() == "files" && $sessConf->getSavePath() != "") {
$this->saveToFiles($sessConf->getSavePath());
}
Expand Down