Skip to content

Commit

Permalink
fix cookie driver
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Nov 11, 2024
1 parent 3e633c2 commit e5e02e3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Drivers/CookieDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Elegantly\Referrer\ReferrerSources;
use Illuminate\Support\Facades\Cookie;
use Symfony\Component\HttpFoundation\Cookie as SymfonyCookie;

/**
* @phpstan-import-type ReferrerSourcesArray from ReferrerSources
Expand Down Expand Up @@ -39,10 +38,10 @@ public static function getLifetimeFromConfig(): int
public function put(ReferrerSources $sources): void
{
Cookie::queue(
new SymfonyCookie(
Cookie::make(
name: $this->name,
value: $sources->toJson(),
expire: now()->addSeconds($this->lifetime)
minutes: (int) ($this->lifetime / 60)
)
);
}
Expand All @@ -65,6 +64,6 @@ public function get(): ?ReferrerSources

public function forget(): void
{
Cookie::forget($this->name);
Cookie::expire($this->name);
}
}

0 comments on commit e5e02e3

Please sign in to comment.