File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ parameters:
22 user_com.frontend_api_key : ' %env(USER_COM_FRONTEND_API_KEY)%'
33 user_com.encryption_key : ' %env(USER_COM_ENCRYPTION_KEY)%'
44 user_com.encryption_iv : ' %env(USER_COM_ENCRYPTION_IV)%'
5-
5+ user_com.cookie_domain : ' %env(USER_COM_COOKIE_DOMAIN)%'
6+
67twig :
78 globals :
89 user_com_frontend_api_key : ' %user_com.frontend_api_key%'
Original file line number Diff line number Diff line change 1010 <argument type =" service" id =" request_stack" />
1111 <argument type =" service" id =" security.token_storage" />
1212 <argument type =" service" id =" bit_bag.sylius_user_com_plugin.cookie.cookie_queue" />
13+ <argument >%user_com.cookie_domain%</argument >
1314 </service >
1415
1516 <service
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public function __construct(
2323 private readonly RequestStack $ requestStack ,
2424 private readonly TokenStorageInterface $ tokenStorage ,
2525 private readonly CookieQueueInterface $ queue ,
26+ private readonly ?string $ cookieDomain = null ,
2627 ) {
2728 }
2829
@@ -51,6 +52,10 @@ public function setUserComCookie(string $value): void
5152 ->withHttpOnly (true )
5253 ->withSameSite ('lax ' );
5354
55+ if (null !== $ this ->cookieDomain && '' !== $ this ->cookieDomain ) {
56+ $ cookie = $ cookie ->withDomain ($ this ->cookieDomain );
57+ }
58+
5459 $ this ->queue ->queue ($ cookie );
5560 }
5661
Original file line number Diff line number Diff line change @@ -36,5 +36,6 @@ SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=doctrine://defau
3636USER_COM_FRONTEND_API_KEY = " "
3737USER_COM_ENCRYPTION_KEY = your-32-character-long-key
3838USER_COM_ENCRYPTION_IV = your-16-character-long-
39+ USER_COM_COOKIE_DOMAIN = " "
3940MESSENGER_USER_COM_ASYNCHRONOUS_DSN = " doctrine://default"
4041# ##< UserCom
You can’t perform that action at this time.
0 commit comments