From 3b54e73a34336850b02051af13d7390ab51dda6c Mon Sep 17 00:00:00 2001 From: tsengyushiang Date: Tue, 12 Mar 2024 14:50:00 +0800 Subject: [PATCH] Update vanillaJs.md --- frontend/vanillaJs.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/vanillaJs.md b/frontend/vanillaJs.md index 9bc0201..59ae40e 100644 --- a/frontend/vanillaJs.md +++ b/frontend/vanillaJs.md @@ -240,6 +240,16 @@ const applyMask = (mask, canvas, result) => { ``` ### Iframe +- Embed apps in iframe should consider SameSite. ([reference](https://medium.com/%E7%A8%8B%E5%BC%8F%E7%8C%BF%E5%90%83%E9%A6%99%E8%95%89/%E5%86%8D%E6%8E%A2%E5%90%8C%E6%BA%90%E6%94%BF%E7%AD%96-%E8%AB%87-samesite-%E8%A8%AD%E5%AE%9A%E5%B0%8D-cookie-%E7%9A%84%E5%BD%B1%E9%9F%BF%E8%88%87%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A0%85-6195d10d4441)) + +```javascript +// server-side +res.cookie("name", value, { + samSite: "None", + secure: true, +}); +``` + - Make iframe content bigger ```css @@ -460,4 +470,4 @@ const Recorder = (() => { })(); export default Recorder; -``` \ No newline at end of file +```