Hallo zusammen ich habe eine Geschützte Seite erstellt mit Passwort.
Nach Eingabe des Passworts wird ja ein Cookie gespeichert, so dass man das Passwort nicht immer eingeben muss.
Nur mir sind 10 Tage Lebensdauer dieses Cookies etwas lange!
Habe mal folgenden Code in mein functions.php kopiert:
PHP
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);
}
Wie es als Lösungvorschlag auf dieser Seite geschrieben ist.
Nur das ganze funktioniert nicht, es sind immer noch 10 Tage!
Weiss jemand wie man das richtig auf eine vernünftige Dauer stellen kann?