woocommerce_cookie_httponly
Controls whether the cookie should only be accessible via the HTTP protocol, or if it should also be accessible to Javascript.
Usage
add_filter( 'woocommerce_cookie_httponly', 'wp_kama_woocommerce_cookie_httponly_filter', 10, 5 );
/**
* Function for `woocommerce_cookie_httponly` filter-hook.
*
* @param bool $httponly If the cookie should only be accessible via the HTTP protocol.
* @param string $name Cookie name.
* @param string $value Cookie value.
* @param int $expire When the cookie should expire.
* @param bool $secure If the cookie should only be served over HTTPS.
*
* @return bool
*/
function wp_kama_woocommerce_cookie_httponly_filter( $httponly, $name, $value, $expire, $secure ){
// filter...
return $httponly;
}
- $httponly(true|false)
- If the cookie should only be accessible via the HTTP protocol.
- $name(string)
- Cookie name.
- $value(string)
- Cookie value.
- $expire(int)
- When the cookie should expire.
- $secure(true|false)
- If the cookie should only be served over HTTPS.
Changelog
| Since 3.3.0 | Introduced. |
Where the hook is called
woocommerce/includes/wc-core-functions.php 966
'httponly' => apply_filters( 'woocommerce_cookie_httponly', $httponly, $name, $value, $expire, $secure ),