Make sequoia-subscribe cookie Secure
2152ab37
Fixes issue #21
1 file(s) · +2 −2
Fixes issue #21
| 161 | 161 | const expires = new Date( |
|
| 162 | 162 | Date.now() + 365 * 24 * 60 * 60 * 1000, |
|
| 163 | 163 | ).toUTCString(); |
|
| 164 | - | document.cookie = `sequoia_did=${encodeURIComponent(did)}; expires=${expires}; path=/; SameSite=Lax`; |
|
| 164 | + | document.cookie = `sequoia_did=${encodeURIComponent(did)}; Expires=${expires}; Path=/; SameSite=Lax; Secure`; |
|
| 165 | 165 | } catch { |
|
| 166 | 166 | // Cookie write may fail in some embedded contexts |
|
| 167 | 167 | } |
|
| 201 | 201 | function clearSubscriberDid() { |
|
| 202 | 202 | try { |
|
| 203 | 203 | document.cookie = |
|
| 204 | - | "sequoia_did=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; SameSite=Lax"; |
|
| 204 | + | "sequoia_did=; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; SameSite=Lax; Secure"; |
|
| 205 | 205 | } catch { |
|
| 206 | 206 | // ignore |
|
| 207 | 207 | } |
|