Keep Users Logged In As Long As I Like

What you found is actually perfectly accurate. With WP’s commitment to backwards compatibility it’s not that common for thing to stop working.

This filter is used in wp_set_auth_cookie() to calculate the duration. Resulting value is used in PHP’s setcookie().

There is no mention of specifics limits in documentation, so in practice the value is limited by integer range for Unix timestamp (practically at the moment — year 2038 give or take).

So you are pretty set on WP side, but I’d also look into how browsers handle it. I don’t think I heard about extra long expiration times used in practice outside of development. So it’s not well covered topic.

Leave a Comment