| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr> |
| 7 |
<th scope="row">Cookie security |
| 8 |
<p class="description"><?php _e('A secure cookie is only sent to the server with a encrypted request over the HTTPS protocol.', 'http-headers'); ?></p> |
| 9 |
<p class="description"><?php _e("To prevent cross-site scripting (XSS) attacks, HttpOnly cookies are inaccessible to JavaScript's Document.cookie API; they are only sent to the server.", 'http-headers'); ?></p> |
| 10 |
</th> |
| 11 |
<td> |
| 12 |
<fieldset> |
| 13 |
<legend class="screen-reader-text">Cookie security</legend> |
| 14 |
<?php |
| 15 |
$cookie_security = get_option('hh_cookie_security', 0); |
| 16 |
foreach ($bools as $k => $v) |
| 17 |
{ |
| 18 |
?><p><label><input type="radio" class="http-header" name="hh_cookie_security" value="<?php echo $k; ?>"<?php checked($cookie_security, $k); ?> /> <?php echo $v; ?></label></p><?php |
| 19 |
} |
| 20 |
?> |
| 21 |
</fieldset> |
| 22 |
</td> |
| 23 |
<td> |
| 24 |
<?php settings_fields( 'http-headers-cose' ); ?> |
| 25 |
<?php do_settings_sections( 'http-headers-cose' ); ?> |
| 26 |
<?php |
| 27 |
$items = array('Secure', 'HttpOnly'); |
| 28 |
$cookie_security_value = get_option('hh_cookie_security_value'); |
| 29 |
foreach ($items as $item) |
| 30 |
{ |
| 31 |
?><p><label><input type="checkbox" class="http-header-value" name="hh_cookie_security_value[<?php echo $item; ?>]" value="1"<?php echo !is_array($cookie_security_value) || !array_key_exists($item, $cookie_security_value) ? NULL : ' checked'; ?><?php echo $cookie_security == 1 ? NULL : ' readonly'; ?> /> <?php echo $item; ?></label></p><?php |
| 32 |
} |
| 33 |
?> |
| 34 |
</td> |
| 35 |
</tr> |