• Joe Bloggs

    (@joe-bloggs)


    Hi Ben,

    very useful plugin, many thanks ..

    I have one question regarding the cookies.

    When I log into the blog using the plugin, the browser keeps a cookie, so when I visit the blog in the same browser again, it doesn’t require password anymore.

    I’d like to change this behaviour so the blog requires a password every single time i wnat to login.

    In one of your previous posts you mention this :

    ” The cookie lasts for 48 hours by default. This can be adjusted using the ‘password_protected_auth_cookie_expiration’ filter which should return the number of seconds the cookie should last for. “

    I think this is exactly what I am looking for correct ? To change the cookie time expiry for let’s say 5 minutes ??

    But I’m not a coder, would you be able to point me exactly to the piece of code that I should be changing ??

    I really appreciate your help, J

    https://wordpress.org/plugins/password-protected/

Viewing 1 replies (of 1 total)
  • The current filters in place only allow you to set the expiry time based on your web site’s server time + a specific amount of time, but this doesn’t take into account the user’s timezone.

    This means that if set to any duration less than 12 hours and the user is -12 hours behind your server time, they will be logged out immediately.

    I’m currently looking into refactoring the plugin to prevent this.

Viewing 1 replies (of 1 total)
  • The topic ‘Cookie Expiry’ is closed to new replies.