The post password cookie is set with:
setcookie(
'wp-postpass_' . COOKIEHASH,
$hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ),
$expire,
COOKIEPATH,
COOKIE_DOMAIN,
$secure
);
in the wp-login.php file.
We can then use the clear_auth_cookie hook, in the wp_clear_auth_cookie() function, to clear it on logout:
/**
* Clear the Post Password Cookie on logout.
*
* @link http://wordpress.stackexchange.com/a/198890/26350
*/
add_action( 'clear_auth_cookie', function()
{
setcookie(
'wp-postpass_' . COOKIEHASH,
'',
time() - YEAR_IN_SECONDS,
COOKIEPATH,
COOKIE_DOMAIN
);
});
Related Posts:
- How to delete Passwrd Protected posts cookies when a user logged out from the site
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Preventing BFA in WordPress without using a plugin
- Specific way to allow WordPress users to view their current password? And edit it?
- My WP site and password was hacked, what to do? [closed]
- How to resolve these findings from security audit
- Stop the user if login from the cookies
- What security concerns should I have when setting FS_METHOD to “direct” in wp-config?
- I found this in a plugin. What does it do? is it dangerous?
- Disabled plugins are they security holes – rumor or reality?
- What could a hacker do with my wp-config.php
- How Can I Securely Implement a Password-less Login Feature?
- Security and .htaccess
- Are there procedures to prevent malicious plugin updates?
- Keep one user logged for a year?
- How do I email a new page password to somebody every month?
- Should we use plugins that aren’t available from the official WordPress site?
- Why allow overriding crucial pluggable functions wp_verify_nonce and wp_create_nonce?
- Where should my plugin POST to?
- Should I install plugins to my WordPress installation from web sites having in URL “nulled” or, “null”?
- login to wordpress with Get variables instead of Post
- Detecting $_GET parameters from any page + Cookie
- Disabled plugins are security holes – rumor or reality?
- Multiple Password Portal Page BEFORE User Account Set Up
- Prevent Brute Force Attack
- Problem protecting a page with a password
- Upgrading WordPress 4.0 asks for FTP password
- When is it useful to use wp_verify_nonce
- Protecting against malicious code in WordPress plugin updates
- Set cookie then immediantly refresh the page
- Disable WordPress password reset via mails,instead notify admin about the reset request
- How to expire all wordpress user passwords instantly?
- Weird problems after recovery from security breach
- How can we deal with unmaintained plugins with vulnerabilities?
- Security issues with WP sites
- Escape when echoed
- Should you escape hardcoded URLs?
- Do We Need to Validate, Sanitize, or Filter Simple Numerical Superglobals (Cookies and Post)?
- How can I make uploaded images in the editor load with HTTPS?
- How to stop xmlrpc attacks without disabling component to allow JetPack to work in WordPress?
- WordPress filter that hook after each action/filter hook
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- How to save generated JWT token to cookies on login?
- How to block plugin activations with no known user or coming from unknown IP address range?
- Check for security updates
- User Session and Stored Cookies not get removed
- Where does the cookie mo_page_views_counter come from?
- Standard Fail2Ban vs. WP Fail2ban vs. WP Fail2Ban Redux
- Why can’t I access my Intranet LDAPS with NADI?
- Malicious File Upload [closed]
- Stop Plugin Enumeration [closed]
- How to handle cookies from a WordPress plugin on a cached page?
- Login cookies set as wrong domain
- Hack-Proof OR Security in WordPress — is it real?
- Security and Must Use Plugins
- Basic password protection without using users and roles
- Is Timthumb still broken? What security measures should be taken?
- Is it safe to use admin-ajax.php in the frontend?
- How to protect WordPress from security scanner [closed]
- Is there any pre-existing plugin to track and block IPs with suspicious activity on my site?
- How to prevent plugins from sniffing/stealing other plugins’ options?
- How to deal with Slow HTTP POST (slowloris) vulnerability
- Running multiple security plugins
- Displaying content based on drop-down menu selection sitewide
- Blurry images when loading the page first time
- Plugin: connect to external database without showing password
- If I use an alternative login (e.g. CAS or other SSO) plugin, is my site protected from the recent brute force login attempts?
- WP Insert Post If user refreshes override new post
- 404 errors when updating options in admin dashboard
- Website Captcha Error: The reCAPTCHA wasn’t entered correctly
- Cookies set by a plugin in wordpress for tracking
- WordPress search shows protected content
- Can I disable xml-rpc by setting it to false?
- Help to Create a Simple Plugin to make a post
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- Block Google tracking on refuse consent of the user with plugin
- wp_set_password() does not work!
- Login/password protected “client page”
- WordPress Admin login redirect to homepage
- “Fire Secure” menu item
- How to make a page both “private” and “password protected”
- https rewrite not working for All in one security Brute force > rename login url
- Members-only page, but accessible via sharable link
- How can I store user preferences in WordPress and retreive them later?
- WordPress delete cookie
- admin-ajax.php not working properly on subdomains
- Redux framework somehow added to my site, can’t locate in plugins
- wp_verify_nonce fails always
- Validating values using Settings API?
- using .htaccess only for wordpress security no plugins
- How can I allow for the password protect feature to allow visitors to enter any number at all?
- Problem with permissions in wp-content/plugins
- WordPress Plugin: Where should I put my cookies for cURL?
- ERROR: Cookies are blocked due to unexpected output – no access to FTP
- How I can hide my wp folders from Inspect Element (Developer Tools)
- How to Find WordPress site has backdoor login Codes
- How to rename files during upload to a random string?
- Is it a good idea to restrict the REST API
- WordPress.Security.NonceVerification.Recommended
- Lost Password of my site, how to reset wordpress password?