---
title: "CookieGenerateByAccessTokenPayload"
description: "生成cookie响应内容，作为网页端登录态cookie"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/objects/cookie-generate-by-access-token-payload'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/objects/cookie-generate-by-access-token-payload.md'
---
# CookieGenerateByAccessTokenPayload

生成cookie响应内容，作为网页端登录态cookie

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Object

## Type Signature

`CookieGenerateByAccessTokenPayload`

## Fields

* `cookieDomainLevel`

  [Int](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/int.md)

  cookie写入域名级别，1：写入一级域名下，2：写入二级域名下

* `cookies`

  [[CookieInfo]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/cookie-info.md)

  cookie 内容

* `customerUserErrors`

  [[CustomerUserError!]!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/objects/customer-user-error.md)

  错误信息

* `httpOnly`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/boolean.md)

  是否需要写入httpOnly

* `maxAge`

  [Int](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/int.md)

  cookie有效期，单位秒

* `uid`

  [ID](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/id.md)

  客户uid

## Schema Definition

```graphql
type CookieGenerateByAccessTokenPayload { 
	cookieDomainLevel: Int
	cookies: [CookieInfo]
	customerUserErrors: [CustomerUserError!]!
	httpOnly: Boolean
	maxAge: Int
	uid: ID 
}
```

## Field from

* [Mutation](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/customers/mutations/cookie-generate-by-access-token.md).cookieGenerateByAccessToken

  根据AccessToken生成cookie

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes)。

