Skip to content

Commit b2fea5d

Browse files
committed
Avoid overwrite last ip or user_agent with empty ones
tlaverdure/laravel-echo-server#546 In some cases request doesn'nt has `ipAddress` or `userAgent`, with this change it avoid overwrite the last reported data
1 parent dcda06f commit b2fea5d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Illuminate/Session/DatabaseSessionHandler.php

+7
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ protected function performInsert($sessionId, $payload)
174174
*/
175175
protected function performUpdate($sessionId, $payload)
176176
{
177+
if (! $payload['ip_address']) {
178+
unset($payload['ip_address']);
179+
}
180+
if (! $payload['user_agent']) {
181+
unset($payload['user_agent']);
182+
}
183+
177184
return $this->getQuery()->where('id', $sessionId)->update($payload);
178185
}
179186

0 commit comments

Comments
 (0)