0

我正在使用redux-cookies-middleware,在那里我可以通过只是namevaluecookie。但是如果我需要添加path我应该如何通过呢?

{ session: { name: 'session' // name of the cookie in which the value of session will be synced }, 'auth.token': { name: 'auth_token' // name of the cookie in which the value of auth.token will be synced } }

4

1 回答 1

0

setCookie初始化中间件时需要使用该选项。这是设置 cookie 时要调用的函数的占位符。一旦您拥有用于设置 cookie 的自定义功能,您将可以更好地控制路径、域、到期等内容。

于 2018-07-23T16:42:41.030 回答