From d393f4f829cd3d3cc5f0059a804791bd4c241c29 Mon Sep 17 00:00:00 2001 From: Saidi Date: Wed, 4 Dec 2024 18:51:53 +0100 Subject: [PATCH] remove cookie #3397 --- src/Controller/Back/ExportSignalementController.php | 5 +---- src/Controller/Back/SignalementListController.php | 11 +---------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Controller/Back/ExportSignalementController.php b/src/Controller/Back/ExportSignalementController.php index a39c11219..d0a8a70df 100644 --- a/src/Controller/Back/ExportSignalementController.php +++ b/src/Controller/Back/ExportSignalementController.php @@ -25,10 +25,7 @@ public function index( ): Response { /** @var User $user */ $user = $this->getUser(); - - $filters = $options = json_decode($request->cookies->get('filters'), true) - ?? $request->getSession()->get('filters', ['isImported' => '1']); - + $filters = $options = $request->getSession()->get('filters', ['isImported' => '1']); $count_signalements = $signalementManager->findSignalementAffectationList($user, $options, true); $textFilters = $signalementExportFiltersDisplay->filtersToText($filters); diff --git a/src/Controller/Back/SignalementListController.php b/src/Controller/Back/SignalementListController.php index 4efa8801e..cccf54a18 100755 --- a/src/Controller/Back/SignalementListController.php +++ b/src/Controller/Back/SignalementListController.php @@ -7,7 +7,6 @@ use App\Manager\SignalementManager; use App\Service\Signalement\SearchFilter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\SessionInterface; @@ -45,19 +44,11 @@ public function list( $session->set('signalementSearchQuery', $signalementQuery); $signalements = $signalementManager->findSignalementAffectationList($user, $filters); - $response = $this->json( + return $this->json( $signalements, Response::HTTP_OK, ['content-type' => 'application/json'], ['groups' => ['signalements:read']] ); - - $cookie = Cookie::create('filters') - ->withValue(json_encode($filters)) - ->withExpires(strtotime('+1 hour')); - - $response->headers->setCookie($cookie); - - return $response; } }