从 Service Worker 中读取 cookie? [英] Read cookies from within a Service Worker?

查看:54
本文介绍了从 Service Worker 中读取 cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 Service Worker 中读取 cookie 以在设置缓存时使用它,但找不到任何方法.

I would like to read a cookie within my service worker to use it when setting up my caches, but can't find any way of doing it.

有没有办法做到这一点,或者我是否需要将 cookie 数据复制到 IDB 或类似数据中?

Is there any way of doing that, or will I need to duplicate cookie data into IDB or similar?

推荐答案

目前,您无法访问它们.在 W3C ServiceWorker 存储库中讨论了,关于添加方法以在未来访问它们.

Currently, you can't access them. There's a discussion in the W3C ServiceWorker repo about adding methods to access them in the future.

这篇关于从 Service Worker 中读取 cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆