We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cd5fd2 commit 4074f33Copy full SHA for 4074f33
src/content-scripts/cache.ts
@@ -10,7 +10,18 @@ export const cache = {
10
},
11
12
pasteCookie (cookie: string) {
13
- window.document.cookie = cookie
+ if (!cookie) {
14
+ return
15
+ }
16
+
17
+ cookie.split(';').forEach(item => {
18
+ const [key, value] = item.split('=')
19
+ console.log(key)
20
+ const date = new Date()
21
+ date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000))
22
+ const expires = '; expires=' + date.toUTCString()
23
+ document.cookie = key + '=' + (value || '') + expires + '; path=/'
24
+ })
25
26
27
clearCookie () {
0 commit comments