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?
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- Are WordPress Plugins essential?
- I found this in a plugin. What does it do? is it dangerous?
- What are the common security flaws I need to look for? [closed]
- 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
- Why “Contact Form 7” doesn’t update PHPmailer library?
- Are there procedures to prevent malicious plugin updates?
- Secure WordPress paid plugin
- Keep one user logged for a year?
- Disable saving comment details (name, e-mail) in cookie?
- How to make media upload private? [duplicate]
- Does WordPress contain “default” anti-SQL injection code that responds with a 404 error?
- What does a security risk in a plugin look like?
- How do I email a new page password to somebody every month?
- WordPress Capabilities: edit_user vs edit_users
- Should we use plugins that aren’t available from the official WordPress site?
- How to check plugins for malicious code?
- How to properly secure my WordPress installation?
- Why allow overriding crucial pluggable functions wp_verify_nonce and wp_create_nonce?
- Where should my plugin POST to?
- Add new password rule to Ultimate Member register form
- 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?
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Multiple Password Portal Page BEFORE User Account Set Up
- Should I use RIPS tool to test my themes and plugins?
- Is it possible to block subscriber users to changing its password?
- Prevent Brute Force Attack
- Problem protecting a page with a password
- Why users disable the WordPress update?
- How many security plugins are too many? [closed]
- Will WordPress username displayed somewhere in the site?
- Upgrading WordPress 4.0 asks for FTP password
- Is revealing just the AUTH_KEY a security issue?
- How Restrict access to admin dashboard by specific static ip?
- How to create a word press user with hashedpassword
- When is it useful to use wp_verify_nonce
- Protecting against malicious code in WordPress plugin updates
- Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
- Set cookie then immediantly refresh the page
- Questions about brute force attacks on the admin username, coming from amazon IP addresses
- Disable WordPress password reset via mails,instead notify admin about the reset request
- Why Better WP security plugin returns 418 I’m a Teapot “error”?
- How to expire all wordpress user passwords instantly?
- Popup Cookie WordPress select language and section (Elementor)
- How to limit WordPress pages during updates?
- rms_unique_wp_mu_pl_fl_nm.php
- Weird problems after recovery from security breach
- How can we deal with unmaintained plugins with vulnerabilities?
- Security issues with WP sites
- Security checking in meta_box save is reluctant?
- 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?
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- Why is my staging subdomain not sending wordpress_logged_in cookies?
- WordPress filter that hook after each action/filter hook
- The safest way to automate WordPress backups
- wp_create_nonce function doesn’t work inside a plugin?
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Upgraded to latest version – 3.0.3 and Now I get a “sufficient permissions to access this page” error
- Unwanted Links and Spam WordPress Pages and Posts
- How can I allow for the password protect feature to allow visitors to enter any number at all?
- Alter the reset password link
- Password Protected Directory Link Shows Maintenance Mode Page
- Problem with permissions in wp-content/plugins
- WordPress Plugin: Where should I put my cookies for cURL?
- Is it possible to send user new password after they clicking on forgot password in word press
- File permissions for wp-minify plugin
- What is the recommended way to be notified of security updates to my plugins? [closed]
- Undefined constant error in pluggable.php
- 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?
- WordPress User Registration/ Sign Up -> Able to take Paid Certification Courses & keep track of Completed Certificates
- Block Root REST API Route using custom &/or iThemes
- Is it a good idea to restrict the REST API
- WordPress.Security.NonceVerification.Recommended
- Secure way to add JS Script to WordPress filesystem
- Bullet proofing a server with 150 WP insallations
- Code Snippets security when selecting “only run on front end”
- What forum plugin can I use to allow non-registered users to create posts and comment? [closed]
- Lost Password of my site, how to reset wordpress password?
- How to verify/test that a custom built wordpress theme is as secure as possible?