You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace Lc\SovBundle\Component;
-
- use Lc\SovBundle\Resolver\UrlResolver;
- use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
-
- class CookieComponent
- {
- protected UrlResolver $urlResolver;
- protected ParameterBagInterface $parameterBag;
-
- public function __construct(UrlResolver $urlResolver, ParameterBagInterface $parameterBag)
- {
- $this->urlResolver = $urlResolver;
- $this->parameterBag = $parameterBag;
- }
-
- public function getCookieDomain()
- {
- return ($this->urlResolver->isServerLocalhost()) ? null : $this->parameterBag->get('app.cookie_domain_distant');
- }
-
- public function cryptCookie($data)
- {
- return base64_encode($data);
- }
-
- public function decryptCookie($data)
- {
- return base64_decode($data);
- }
- }
|