We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcda06f commit bbf7207Copy full SHA for bbf7207
src/Illuminate/Session/DatabaseSessionHandler.php
@@ -233,11 +233,13 @@ protected function userId()
233
*/
234
protected function addRequestInformation(&$payload)
235
{
236
- if ($this->container->bound('request')) {
237
- $payload = array_merge($payload, [
238
- 'ip_address' => $this->ipAddress(),
239
- 'user_agent' => $this->userAgent(),
240
- ]);
+ if (! $this->container->bound('request')) {
+ if ($this->ipAddress()) {
+ $payload['ip_address'] = $this->ipAddress();
+ }
+ if ($this->userAgent()) {
241
+ $payload['user_agent'] = $this->userAgent();
242
243
}
244
245
return $this;
0 commit comments