PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/component/class-password-protection.php +22 -2 5.8.1 → 6.3.0 View file →
@@ -205,9 +205,19 @@
205 205 * @param int $time The expiration time of the cookie.
206 206 */
207 207 public function set_cookie_notice( $name, $value, $time ) {
208 208 if ( ! isset( $_COOKIE[ $name ] ) ) {
209 - setcookie( $name, $value, $time, '/' );
209 + setcookie(
210 + $name,
211 + $value,
212 + array(
213 + 'expires' => $time,
214 + 'path' => '/',
215 + 'secure' => is_ssl(),
216 + 'httponly' => true,
217 + 'samesite' => 'Lax',
218 + )
219 + );
210 220 }
211 221 }
212 222
213 223 /**
@@ -221,9 +231,19 @@
221 231 * @since 4.3.0 Removed the $time parameter.
222 232 */
223 233 public function remove_cookie_notice( string $name ): void {
224 234 if ( isset( $_COOKIE[ $name ] ) && ! headers_sent() ) {
225 - setcookie( $name, '', time() - YEAR_IN_SECONDS, '/' );
235 + setcookie(
236 + $name,
237 + '',
238 + array(
239 + 'expires' => time() - YEAR_IN_SECONDS,
240 + 'path' => '/',
241 + 'secure' => is_ssl(),
242 + 'httponly' => true,
243 + 'samesite' => 'Lax',
244 + )
245 + );
226 246 }
227 247 $this->remove_extra_cookies();
228 248 }
229 249