Wouldso would I display the present period of time left from the cookie/session for any drenched in user of WordPress? So for instance when the cookie timeout is 24 hrs and also the user continues to be drenched set for 2 hrs then your output could be 22 hrs.

I do not think you could do since you can't determine a cookie's expiry date from PHP or Javascript. You might have the ability to build something on the top from the existing Wordpress sign in system to keep the date in another cookie whenever a user logs in.


Really, it appears like Wordpress stores the sign in expiry date (together with other sign in particulars) inside a cookie prefixed 'wordpress_drenched_in_'. So, you need to have the ability to make a move such as the below to show time until expiry.

foreach ($_COOKIE as $key => $cookie) {
    if (strpos($key, 'wordpress_logged_in_') === 0) {
        $cookie_array = explode('|', $cookie);
        $expiry_time = $cookie_array[1];
        echo human_time_diff(mktime(), $expiry_time);
        break;
    }
}