0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

META 要素で Set-Cookie が使えなくなった

Last updated at Posted at 2021-05-02

HTML Standard では次のように定義されています。
4.2.5.3 Pragma directives
meta_may02.png

Set-Cookie は Non-conforming ですが、最近の Chrome, Firefox では使えません。

テスト用の HTML ファイル

meta_test.html
<!DOCTYPE html>
<html lang="ja">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF8">
<meta http-equiv="Set-Cookie" content="key1=good;SameSite=None;Secure">
<TITLE>Met Test</TITLE>
<script type="text/javascript">
document.cookie = "aa=hello;SameSite=None;Secure"
document.cookie = "bb=みかん;SameSite=None;Secure"
document.cookie = "cc=メロン;SameSite=None;Secure"
console.log(document.cookie)
</script>
</head>
<body>
May/02/2021<br />
</body>
</html>

これを、FireFox でアクセスすると
firefox_may02.png

Chrome でアクセスすると
chrome_may02.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?