Shopware6 注册必需(技术性)Cookies 用于应用程序

huangapple go评论59阅读模式
英文:

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>

huangapple
  • 本文由 发表于 2023年4月13日 14:33:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76002328.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定