英文:
Shopware6 Register required(technical) cookies for app
问题
I am currently working on a payment app with Stripe services. This app uses javascript from Stripe and it automatically sets some cookies for security purposes. They are tokens and hashes that Stripe uses to calculate some signatures. These are technically required cookies but I didn't find anything about them in the app documentation:
[https://developer.shopware.com/docs/guides/plugins/apps/storefront/cookies-with-apps]
This guide is only for comfort cookies.
I would like to know how I can register cookies that are technically required. Also, I don't know beforehand what values they will get, I do know the cookie names though. How can I add these to the cookie consent manager?
英文:
I am currently working on a payment app with Stripe services. This app uses javascript from Stripe and it automatically sets some cookies for security purposes. They are tokens and hashes that Stripe uses to calculate some signatures. These are technically required cookies but I didn't find anything about them in the app documentation:
[https://developer.shopware.com/docs/guides/plugins/apps/storefront/cookies-with-apps]
This guide is only for comfort cookies.
I would like to know how I can register cookies that are technically required. Also I don't know beforehand what values they will get, I do know the cookie names though. How can I add these to the cookie consent manager?
答案1
得分: 1
只需使用现有的片段作为应用程序的 cookie 组的 snippet-name
,然后现有组的条目和您的自定义条目将被合并。
<cookies>
<group>
<snippet-name>cookie.groupRequired</snippet-name>
<entries>
<cookie>
<cookie>my-cookie</cookie>
<snippet-name>example-app-with-cookies.my-cookie.name</snippet-name>
<snippet-description>example-app-with-cookies.my-cookie.description</snippet-description>
<value>a static value for the cookie</value>
<expiration>1</expiration>
</cookie>
</entries>
</group>
</cookies>
英文:
Simply use the existing snippet for the group of required cookies as snippet-name
of your apps cookie group and the existing group's entries and your custom entries will be merged.
<cookies>
<group>
<snippet-name>cookie.groupRequired</snippet-name>
<entries>
<cookie>
<cookie>my-cookie</cookie>
<snippet-name>example-app-with-cookies.my-cookie.name</snippet-name>
<snippet-description>example-app-with-cookies.my-cookie.description</snippet-description>
<value>a static value for the cookie</value>
<expiration>1</expiration>
</cookie>
</entries>
</group>
</cookies>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论