Im currently using php 8.3.8 using a custiom session handler classs with a read function that reads from a db and looks like this:
public function read(string $id): string|false
{
try {
$result = $this->db->table("sessions")->where('sesskey', $id)->first();
return $result ? (string)$result->value : '';
} catch(Exception) {
return false;
}
}
But EVERY time it NOT returning an empty string, even if its just one character, it always fails with “session_start(): Failed to decode session object. Session has been destroyed“. IF its just the empty string, everything runs fine. Ive tried things like setting a temp dir with ini_set('session.save_path', sys_get_temp_dir())
but i still get the same results. I’ve been scouring all over for different solutions, like ensuring its the very first thing but nothing so far.
Am i perhaps missing some other setting that i need for using a custom session handler?