diff --git a/system/Session/Handlers/DatabaseHandler.php b/system/Session/Handlers/DatabaseHandler.php index 18da544..974fb87 100644 --- a/system/Session/Handlers/DatabaseHandler.php +++ b/system/Session/Handlers/DatabaseHandler.php @@ -172,11 +172,10 @@ $insertData = [ 'id' => $id, 'ip_address' => $this->ipAddress, - 'timestamp' => 'now()', 'data' => $this->platform === 'postgre' ? '\x' . bin2hex($data) : $data, ]; - if (! $this->db->table($this->table)->insert($insertData)) { + if (! $this->db->table($this->table)->set('timestamp', 'now()', false)->insert($insertData)) { return $this->fail(); } @@ -192,13 +191,13 @@ $builder = $builder->where('ip_address', $this->ipAddress); } - $updateData = ['timestamp' => 'now()']; + $updateData = []; if ($this->fingerprint !== md5($data)) { $updateData['data'] = ($this->platform === 'postgre') ? '\x' . bin2hex($data) : $data; } - if (! $builder->update($updateData)) { + if (! $builder->set('timestamp', 'now()', false)->update($updateData)) { return $this->fail(); }