Skip to content

Commit

Permalink
Small tidying of CreateNewWishlistSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
senghe committed Oct 23, 2023
1 parent a579a23 commit 73b6f54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EventSubscriber/CreateNewWishlistSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function onKernelResponse(ResponseEvent $event): void
if (!str_starts_with($currentPath, '/wishlist')) {
return;
}

if ($request->cookies->has($this->wishlistCookieToken)) {
return;
}
Expand All @@ -108,6 +108,6 @@ public function onKernelResponse(ResponseEvent $event): void
$cookie = new Cookie($this->wishlistCookieToken, $wishlistCookieToken, strtotime('+1 year'));
$response->headers->setCookie($cookie);

$event->getRequest()->attributes->remove($this->wishlistCookieToken);
$request->attributes->remove($this->wishlistCookieToken);
}
}

0 comments on commit 73b6f54

Please sign in to comment.