Skip to content

Instantly share code, notes, and snippets.

@dgallegos
Last active July 18, 2020 07:45
Show Gist options
  • Save dgallegos/1a7373002e5f9959315b0a6c31bd72ac to your computer and use it in GitHub Desktop.
Save dgallegos/1a7373002e5f9959315b0a6c31bd72ac to your computer and use it in GitHub Desktop.
WordPress Scan Failed - Non-HttpOnly Session Cookies
// Fix Trustwave Scan
// Non-HttpOnly Session Cookies Identified
// When you load the site you will see the security cookie twice, but the scan still passes.
function set_wordpress_test_cookie_httponly() {
setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, true, true );
}
add_action('login_init','set_wordpress_test_cookie_httponly');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment