The reason is when you execute this code
setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);
It will reset your post password cookie to blank ”, so it just work once To solve this you need to assign the original cookie and extend the timeout, like this
setcookie('wp-postpass_' . COOKIEHASH, $_COOKIE['wp-postpass_' . COOKIEHASH], time() + 60 * 5, COOKIEPATH);
Hope this help
Related Posts:
- Requiring a Visitor to Enter a Password Each Time They visit a Page
- multi page password protection
- Password protect page with multiple passwords
- Password protected post or page – error message by wrong password?
- Automatically change page password
- WordPress protected Pages
- Password Protected Page Not Displaying Content After Entering Password
- Password Protected Page Title
- More Fields Required For Password protect page
- How to make page/post password protected so you must reenter everytime you visit the page?
- IF user is logged in only show certain page
- Password Protect Pages Not Working
- When I enter password, I’m redirected to the WordPress login form
- My Password Protected Pages Aren’t Working
- Get page id by template
- How can I keep the content of my pages version controlled?
- How do I convert a page’s title to lower case?
- page title, parent tilte and grand parent title
- WordPress page edit does not save selected template
- Manual excerpts for pages not working on Search
- How do I set and list page_template with wpcli?
- How to get post or page excerpt using post_excerpt
- How to create virtual pages with information from user meta profile fields?
- Private pages that work when you are not logged into WP admin
- Is there a way to remove or hide individual pages on the Edit Pages screen?
- Add custom admin menu item for pages using a certain template
- Display latest comments on page with pagination
- How to add pages to feed?
- Remove specific page/post from feed
- Create ghost page
- Relative instead of absolute links in pages?
- Produce a plain page with only a message
- List pages by custom field?
- Edit page’s “Restore the backup” link does nothing
- Load specific page template based on URI
- Show preview posts and pages to clients
- Page displays content from different query?
- Can’t locate a hidden private page
- I can’t edit my homepage – the page editor is just blank [closed]
- Page redirects to archive
- Making audio playlist by getting page’s parent’s ID
- Pages Column Sorting WordPress Version 3.0.3
- Adding Page URL to the Pages Admin Table
- Add categories and posts to page hierarchy
- How to retrieve attachments from child pages of a specific Page?
- Admin taking a very long time to load
- how to display sidebar on pages in wordpress
- Hide page templates without using ‘unset’
- Custom page with queries returns 404
- WordPress Site Page Exists but Error 404
- How to capture GET argument on static page
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- Is it possible to check for shortcodes on a page?
- WordPress 3.2 – removed ability to select a page template in the page attributes when adding a new page?
- Can I “protect” a page with a form asking for an email address?
- Show FormCraft form on page open [closed]
- Use same page-mypage.php template for several pages
- Why last blog post excerpt is shown instead of meta description? [closed]
- Prevent non-admin to add/create new pages
- How do you implement a page template automatically being applied to a page?
- How to create cutom link for page
- creating single page with 2 columns while theme is 3 column
- Show parent & child pages with featured image and hide the current page
- Outputting content from page
- Use an archive as the parent of a page?
- Publish page by invoking submit via jQuery
- One author not showing in Author drop down list while editing page
- WordPress Page Protect forwards to Admin Login
- Modifying .page-content background image
- Displaying the blog entries in a Page (using get_posts to retrieve the posts)?
- products category page editing
- “Can’t update in WordPress”
- Different template parts when on different pages
- Updating page template pragmatically
- Adding in additional pages into a custom theme
- Pages in wp-admin is not found 404
- Shortcode runs when editing page
- wordpress page navigation numeric pagination showing same posts on each navigation
- WordPress dosn’t save page/post updates
- WordPress Page All Content In Template Good Or Bad Convention?
- Send e-mail from admin area to adresses in custom field
- Displaying Content Only in Certain Page IDs Not Working
- WordPress white screen with “All Pages”
- How to exclude sidebar from pages?
- Widget & storing a Select box choice
- Annoying notification when trying to create a new page
- Page stuttering on load
- How To List Sibling Pages And Include The Featured Image?
- WP Template Hierarchy – Need help choosing the correct templates
- the_content() Returns post content when I want page content
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- Can’t select a page using is_page()
- If searched in a category show different 404 page
- How can I cycle posts with a #next and #previous script?
- Using Page/Post Slug In Link / URL
- Does WordPress list all pages for crawlers?
- one time visit to the page
- How to display child page from specific parent page in homepage?
- How to display text of a page in home or custom page?
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount