Wtyczka nie została przetestowana z trzema ostatnimi głównymi wydaniami WordPressa. Może nie być już utrzymywana lub obsługiwana, co może skutkować problemem ze zgodnością z nowszymi wersjami WordPressa.

SameSite Cookies

Opis

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.

Zrzuty ekranu

  • Browser response containing the SameSite attribute in Setcookie headers.

Instalacja

  1. Install this plugin as you would with any other plugin.
  2. Enable it.
  3. There is no third step – From this point afterward, authentication cookies your WordPress site uses will contain SameSite flag, and you will be protected from CSRF attacks.

If you find this plugin useful, I’d appreciate you leaving a review on the plugin page.

Najczęściej zadawane pytania

The plugin doesn’t work !?!?

Yeah, probably. This plugin uses what’s called „pluggable functions” supported in WordPress to replace wp_set_auth_cookie function.
This means that any other plugin that tampers with the login cookie parameters will override this plugin, and this plugin may not even get a chance to do what it does.

How do I test if the plugin works

Go to the Login page of your WordPress site, and open your browser’s development tools. Inspect the HTTP POST request made by the browser when you submit the login form. The response headers for Setcookie response headers must contain Samesite=Lax (or the configured value) if the plugin is working.

Note that cookies apart from the authentication cookies are not handled by this plugin, nor it makes sense to add SameSite attribute to them.

See the screenshot as well.

Do I need to have PHP 7.3 or later?

No. PHP 7.3 officially added SameSite cookie support, but this plugin comes with a polyfill to extend support to all previous PHP versions.

Is WordPress vulnerable to CSRF attacks without this plugin?

Without SameSite cookie, WordPress core and third party plugins must implement their own CSRF checks, which can be overlooked, intentionally ignored, or sometimes not even have thought about, which can be the case for contributed plugin. This plugin attempts to solve this with different take and complement existing solutions.

Recenzje

2024-05-14
Looks like nobody read the FAQ: The plugin doesn’t work !?!? Yeah, probably. This plugin uses what’s called “pluggable functions” supported in WordPress to replace wp_set_auth_cookie function.This means that any other plugin that tampers with the login cookie parameters will override this plugin, and this plugin may not even get a chance to do what it does. In my case, the issue was with the plugin WPS Hide Login. Disable that other plugin and this plugin worked correctly.EDIT: In case you still want to change the login URL, use the plugin Admin login URL Change.
2020-04-05
Chrome was showing an error from the developer console. Errors disappeared when I installed this plugin. The plugin is working and problem-free. thank you
2020-03-04
It sorted out my problem. And created another – I can’t log into my site with this plugin installed! Unfortunately….
2020-01-29
This plugin does not work for me. In addition, after I installed it, I could not log back in to the WordPress backend. Had to disable the plugin through WP Engine to gain back the access. waste of time.
Przeczytaj 11 recenzji

Kontrybutorzy i deweloperzy

„SameSite Cookies” jest oprogramowaniem open source. Poniższe osoby miały wkład w rozwój wtyczki.

Zaangażowani

Wtyczka „SameSite Cookies” została przetłumaczona na 1 język. Podziękuj tłumaczom za ich wkład.

Przetłumacz wtyczkę “SameSite Cookies” na swój język.

Interesuje cię rozwój wtyczki?

Przeglądaj kod, sprawdź repozytorium SVN lub czytaj dziennik rozwoju przez RSS.

Rejestr zmian

1.5

  • Fixes a cookie expiration issue that was reported multiple times in the issue queue. Thanks to Jamie Magin (@jamagin at GitHub).

2.0

  • Requires PHP 7.0+
  • Requires WordPress 6.2+
  • Synced pluggable code from upstream for better compatibility with hooks.

2.1

  • Minor readme.txt updates