cookieGenerateByAccessToken
mutation
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Generate cookie response content by accessToken as a login state cookie on the web page(Requirement: This API is only available to whitelisted stores. You need to submit a ticket to access the application instructions.)
Arguments
accessToken
Returns
Cookie written to domain level, 1: written to the first level domain name, 2: written to the second level domain name
cookie content
Error message
whether need to write httpOnly
cookie validity period, in seconds
customer id
Error Code
For more information about common error codes, refer to Status and error codes.
Example
generate cookie content by accessToken
Code
{
"accessToken":"#A01#SID0000103BCFaf1/QOpLLIpYAcfByRgcExJiFJXjQrLxfHstVmsKu9C2QrsTALmOxRixBu7/lCVAsc6oLxbvQ9DpO8cwoDALzOHRfSD6ay/L4QJRy/CYWePa91yTIc+aZAIdsWOMRxfslDniMTO9TdkHaTT10slueGgfBCW6wmshzOUxGYKwykUE+s/lUIs8b+KD1mosZ0w"
}
Response
{
"data": {
"cookieGenerateByAccessToken": {
"cookieDomainLevel": 2,
"cookies": [
{
"cookieKey": "osudb_subappid",
"cookieValue": "1671771213310"
},
{
"cookieKey": "osudb_uid",
"cookieValue": "4217271901"
},
{
"cookieKey": "osudb_oar",
"cookieValue": "#01#SID0000103BMjvullo3DELn47IG9TRkhhA5WiXq+tlrnXDKbs/L5KMSX4O1ijF7CcpTsThgAqDlECqwVYhs8NHoqtPFv+Eul+R4AUJHnWazTnjInS25BiGniV2DD8EhSK6s1aTwKbiEIA1LwJ7wByXO4Ii5pUw54vRXUiEbGwy/9Dhgg"
},
{
"cookieKey": "osudb_appid",
"cookieValue": "1163336839"
}
],
"customerUserErrors": [],
"httpOnly": true,
"maxAge": 2073600,
"uid": "gid://shopline/Customer/4217271901"
}
},
"extensions": {
"dataloader": {
"individual-statistics": {
"LD-com.shopline.merchant.website.openapi.interfaces.OnlineStorefrontApi-commentsQuery": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-queryCollectionByProduct": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.DescriptionQueryService-query": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-images": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-options": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-publishedAtForLoader": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-tagsForLoader": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-template": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variants": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
}
},
"overall-statistics": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
}
},
"metrics": {
"dataFetcherMetrics": [
{
"dfErrorCode": null,
"dfProtocol": "dubbo",
"dfRootCoordinate": "/cookieGenerateByAccessToken",
"dfRt": 123,
"dfServiceIdentity": "com.shopline.ec.openapi.interfaces.CustomerStoreFrontV2Api@generateCookieByAccessToken",
"dfStartTime": 1716948250368
}
],
"graphQLMetrics": {
"appId": "264149",
"appKey": "ac46139a45013c6d13b3bdb53ba7b12b2af6d35f",
"clientIp": "157.119.232.37",
"countryCode": null,
"customizedClientIp": "157.119.232.37",
"deepLevel": 3,
"endParseTimeMillis": 1716948250363,
"errorFieldsCount": 0,
"executionId": "4de60267-b8b0-440f-872b-d41eb7519325",
"fieldCount": 29,
"includeDeprecatedField": false,
"includeQuery": false,
"languageCode": null,
"loaderCount": 0,
"merchantId": "4200333804",
"namespace": "storefront",
"operation": "MUTATION",
"parseRt": 4,
"ratelimitPermits": 1,
"ratelimitRemaining": 1,
"rt": 134,
"saleChannel": null,
"startParseTimeMillis": 1716948250359,
"startTimeMillis": 1716948250359,
"storeId": "1671771213310",
"storePlus": false,
"successType": "SUCCESS",
"tenant": "ec20",
"traceId": "93f9da3f1224ea1680caa3b9409b5954",
"version": "v20240601"
}
},
"tracing": {
"duration": 133754226,
"endTime": "2024-05-29T02:04:10.493Z",
"execution": {
"resolvers": [
{
"duration": 124036680,
"fieldName": "cookieGenerateByAccessToken",
"parentType": "Mutation",
"path": [
"cookieGenerateByAccessToken"
],
"returnType": "CookieGenerateByAccessTokenPayload",
"startOffset": 8276898
},
{
"duration": 27067,
"fieldName": "uid",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"uid"
],
"returnType": "ID",
"startOffset": 132563712
},
{
"duration": 17128,
"fieldName": "cookieDomainLevel",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"cookieDomainLevel"
],
"returnType": "Int",
"startOffset": 132653582
},
{
"duration": 14625,
"fieldName": "maxAge",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"maxAge"
],
"returnType": "Int",
"startOffset": 132737912
},
{
"duration": 14559,
"fieldName": "httpOnly",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"httpOnly"
],
"returnType": "Boolean",
"startOffset": 132788525
},
{
"duration": 15535,
"fieldName": "cookies",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"cookies"
],
"returnType": "[CookieInfo]",
"startOffset": 132921340
},
{
"duration": 15481,
"fieldName": "cookieKey",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
0,
"cookieKey"
],
"returnType": "String",
"startOffset": 133019704
},
{
"duration": 12292,
"fieldName": "cookieValue",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
0,
"cookieValue"
],
"returnType": "String",
"startOffset": 133071551
},
{
"duration": 13592,
"fieldName": "cookieKey",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
1,
"cookieKey"
],
"returnType": "String",
"startOffset": 133171192
},
{
"duration": 12914,
"fieldName": "cookieValue",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
1,
"cookieValue"
],
"returnType": "String",
"startOffset": 133217487
},
{
"duration": 12897,
"fieldName": "cookieKey",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
2,
"cookieKey"
],
"returnType": "String",
"startOffset": 133284481
},
{
"duration": 13328,
"fieldName": "cookieValue",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
2,
"cookieValue"
],
"returnType": "String",
"startOffset": 133326825
},
{
"duration": 13593,
"fieldName": "cookieKey",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
3,
"cookieKey"
],
"returnType": "String",
"startOffset": 133407634
},
{
"duration": 12861,
"fieldName": "cookieValue",
"parentType": "CookieInfo",
"path": [
"cookieGenerateByAccessToken",
"cookies",
3,
"cookieValue"
],
"returnType": "String",
"startOffset": 133455069
},
{
"duration": 13603,
"fieldName": "customerUserErrors",
"parentType": "CookieGenerateByAccessTokenPayload",
"path": [
"cookieGenerateByAccessToken",
"customerUserErrors"
],
"returnType": "[CustomerUserError!]!",
"startOffset": 133560072
}
]
},
"parsing": {
"duration": 3828853,
"startOffset": 3947330
},
"startTime": "2024-05-29T02:04:10.359Z",
"validation": {
"duration": 938224,
"startOffset": 5238576
},
"version": 1
}
}
}
Was this article helpful to you?