WordPress keep logged in after browser close

You can use the following 2 filter hooks add_filter(‘auth_cookie_expiration’, ‘auth_cookie_expiration_filter_5587’); function auth_cookie_expiration_filter_5587() { return YEAR_IN_SECONDS * 5; } and: add_filter(‘auth_cookie_expiration’, function () { return YEAR_IN_SECONDS * 5; });

Sessions in word press [duplicate]

Note, Session must start before header is sent. So you should try – <?php if( !session_id() ){ if( headers_sent() ){ die(‘headers already sent, cant start session’); } else{ session_start(); } } // check existence, or not below 1 if( !isset($_SESSION[‘impression’]) || $_SESSION[‘impression’] < 1 ){ $_SESSION[‘impression’] = 100; } // decrease the value by one … Read more