Set Session Time Limit for Password Protected Posts

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 * … Read more

Why does $_SESSION only work when I am logged in?

WordPress doesn’t use PHP sessions, so WordPress itself can not be related with your sessions working or not regarding if you are logged in or not (I think). Try to call session_start() on init action instead of doing it in a template file and be sure it is called before your custom library is loaded. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)