How would I display the current amount of time left of the cookie/session for a logged in user of WordPress? So for example if the cookie timeout is 24 hours and the user has been logged in for 2 hours then the output would be 22 hours.
Leave a Reply
You must be logged in to post a comment.
WordPress (2.9) stores the log in expiry date (along with other log in details) in a cookie prefixed ‘wordpress_logged_in_’. So, you should be able to do something like the below to display the time until expiry.
If you have Chrome, you can get the Edit This Cookie extension and view or edit cookies without writing code. I believe Firefox has a similar extension.