
內容簡介
該外掛為 WordPress 的驗證 Cookie 添加了「SameSite」Cookie 屬性。在支援的瀏覽器(所有目前的 IE、Edge、Chrome 和 Firefox)中,這可以有效地防止整個 WordPress 站點中的所有跨站點請求偽造攻擊。
SameSite Cookie 屬性在 PHP 7.3 版本中添加,但該外掛附帶了一個解決方案,以支援 WordPress 支持的所有 PHP 版本。
此外掛沒有提供管理 UI:啟用此外掛即可使用!
您可以從 WordPress 配置文件中配置 SameSite 屬性值。您可以從 Lax(默認值)、Strict 或 None 中選擇值。您可以在此閱讀有關 SameSite cookies 的相關資訊。
要配置 SameSite 屬性值,請在 WordPress 配置文件(wp-config.php)中編輯,並在 /** Sets up WordPress vars and included files. */ 上方加入以下行。
`php
define( ‘WP_SAMESITE_COOKIE’, ‘Lax’ ); // 從 ‘Lax’、‘Strict’ 或 ‘None’ 中選擇。
`
請注意,只有驗證 Cookie 會受到影響。而已安裝的外掛設定的常規 Cookie 不會受到影響,也不會提供任何具有意義的 SameSite 屬性值。
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds the “SameSite” cookie flag to WordPress’s authentication cookies. On supported browsers (all current IE, Edge, Chrome, and Firefox), this can effectively prevent all Cross-Site Request Forgery attacks throughout your WordPress site.
SameSite cookie flag support was added to PHP on version 7.3, but this plugin ships with a workaround to support all PHP versions WordPress supports.
There is no administrative UI provided: Activate this plugin, and you are all set!
You can configure the SameSite flag value from your WordPress configuration file. You cna pick a value from Lax (default), Strict, or None. You can read about SameSite cookies here.
To configure the SameSite flag value, edit your WordPress configuration file (wp-config.php), and add the following lines right above /** Sets up WordPress vars and included files. */.
define( 'WP_SAMESITE_COOKIE', 'Lax' ); // Pick from 'Lax', 'Strict', or 'None'.
Note that only the authentication cookies are affected. Regular cookies that your installed plugins set will not be affected, nor provide any meaningful value with SameSite flags.
