Compare commits
No commits in common. "main" and "5.0.0" have entirely different histories.
1 changed files with 1 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue