Title: Protected Pages Timeout ??
Last modified: August 21, 2016

---

# Protected Pages Timeout ??

 *  Resolved [fr2632](https://wordpress.org/support/users/fr2632/)
 * (@fr2632)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/protected-pages-timeout/)
 * Hi guys,
 * Is it possible that wordpress DOES NOT have a timeout on protected pages ?? I
   have been searching everywhere and there is no solution!!
 * Most ppl are talking about a file called `wp-pass.php` which it does not exist
   anymore (at least on my version 3.5.1).
 * Tried to modify the wp-login.php file with the following line:
 * `setcookie(‘wp-postpass_’ . COOKIEHASH, stripslashes( $_POST['post_password']),
   time() + 30, COOKIEPATH);`
 * And it does not work! Probably because this line is referring to Posts and I 
   need Pages, but the `wp-pagepass` does not exist either!
 * How is that possible? I cannot even find a plugin that can fix this issue! If
   someone uses a public computer, or shares a laptop, then forgets to clear the
   cache and cookies, the password is saved by the browser itself FOREVER!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [fr2632](https://wordpress.org/support/users/fr2632/)
 * (@fr2632)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645095)
 * Solution found! Just add this code into function.php of your theme:
 *     ```
       add_action( 'wp', 'post_pw_sess_expire' );
           function post_pw_sess_expire() {
           if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )
           // Setting a time of 0 in setcookie() forces the cookie to expire with the session
           setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);
       }
       ```
   
 * This will forces the cookie to expire with the session, basically when you close
   and reopen the page will ask for the password again 🙂
 *  [iCruz](https://wordpress.org/support/users/icruz/)
 * (@icruz)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645185)
 * It works! thanks fr2632!! you save my life! ^_^
 *  Thread Starter [fr2632](https://wordpress.org/support/users/fr2632/)
 * (@fr2632)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645186)
 * You`re welcome 🙂
 *  [Fobstar](https://wordpress.org/support/users/fobstar/)
 * (@fobstar)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645213)
 * This works great for me to, but if I want to set a time for say 30 minutes before
   expire, replacing 0 with + 1800 (60sec*30min) doesn’t work. Any ideas?
 *  [dotwongdotcom](https://wordpress.org/support/users/dotwongdotcom/)
 * (@dotwongdotcom)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645215)
 * I’m having the same problem as **Fobstar**. Anyone have an idea of what a workaround
   might be?
 *  [lognic](https://wordpress.org/support/users/lognic/)
 * (@lognic)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645216)
 * Login Timeout Settings
 * i have found this plugin see if it help you
 * [http://wordpress.org/plugins/configure-login-timeout/](http://wordpress.org/plugins/configure-login-timeout/)
 *  [dee0954](https://wordpress.org/support/users/dee0954/)
 * (@dee0954)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645223)
 * Thank you fr2632!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Protected Pages Timeout ??’ is closed to new replies.

## Tags

 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [protected](https://wordpress.org/support/topic-tag/protected/)
 * [timeout](https://wordpress.org/support/topic-tag/timeout/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 6 participants
 * Last reply from: [dee0954](https://wordpress.org/support/users/dee0954/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/protected-pages-timeout/#post-3645223)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
