×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Rick Clark
Added: Oct 31, 2012 2:56 PM
Views: 1781
Tags: no tags
  1. add_action( 'wp', 'post_pw_sess_expire' );
  2.     function post_pw_sess_expire() {
  3.     if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )
  4.     // Setting a time of 0 in setcookie() forces the cookie to expire with the session
  5.     setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);
  6. }