New blog posts don’t update on page – How to force update of cookies more frequently?
New blog posts don’t update on page – How to force update of cookies more frequently?
New blog posts don’t update on page – How to force update of cookies more frequently?
You can have two different approaches, Both require some coding. Using a Plugin In your case, there are a lot of good plugins out there but If I’d like to give a name, you’ll have to check Profile Extra Fields by BestWebSoft (I think it doesn’t require a lot of coding) and Advanced Custom Fields … Read more
This is what I ended up adding to my plugin, and users report that it has been successful: add_action( ‘wp_login’, array( $this, ‘after_successful_login’ ), 10, 2 ); /** * Make sure the auth cookie is set when a user logs in * * @param string $login The user’s username * @param object $user The logged … Read more
You can access to any WordPress functions if you first include the wp-load.php to your custom PHP page. <?php require_once(‘path/to/wp-load.php’); if( ! is_user_logged_in() ) { auth_redirect(); } // Your application starts from here… ?>
The problem was some empty spaces in custom plugin outside of <?php … ?> enclosure. This is not a specific issue for cookies and the error is misleading. My custom plugin was only a single php file with 2 extra empty lines. The existing popular question about the same error message doesn’t include any answers … Read more
How are cookie values encoded?
The $_COOKIE array contains only these cookies that came in the request from the browser. setcookie() adds an HTTP header asking the client to send the cookie during subsequent requests. So yeah – you can’t access $_COOKIE in the same request it is set.
Extend Cookie with auth_cookie_expiration not working
Maybe your hook called too early. And after yours, this connection time changes elsewhere. Try to increase priority like that: add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in’, 99, 3); function keep_me_logged_in( $expiration, $user_id, $remember ) {/*your code*/}
Entirely Cookieless WordPress?