Password Protected Pages

Wordpress allows you to assign a password to a page, making it a secure place to store confidential information. By default when a user puts the password in their browser stores a cookie for 10 days. This time can be altered by adding the following code to the themes.php file:

$pass_cookie=''; foreach($_COOKIE as $key=>$value){ if(!strncmp($key,"wp-postpass_",12)){ $pass_cookie = $key; break; } } if($pass_cookie){ setcookie($pass_cookie,'',0); }

The value 0 for the line "setcookie($pass_cookie,",0);" is a value in seconds for how long the cookie should be stored for the user.