Compare commits

..

No commits in common. "main" and "5.0.0" have entirely different histories.
main ... 5.0.0

View file

@ -3,7 +3,6 @@
namespace App\Controller;
use App\Form\UserNameFormType;
use DateTimeImmutable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\RedirectResponse;
@ -34,13 +33,7 @@ final class HomeController extends AbstractController
$response->headers->clearCookie('username');
return $response;
}
$response->headers->setCookie(
new Cookie(
name: 'username',
value: $username,
expire: new DateTimeImmutable('+1 year'),
)
);
$response->headers->setCookie(new Cookie('username', $username));
return $response;
}
$username = $request->cookies->get('username', self::DEFAULT_USERNAME);