Keep Users Logged In As Long As I Like
I'm implementing a Kiosk webapp based off WordPress and I have some conditionals which are key, they work based on whether user is logged in or not.
I'm aware that after user clicks "remember me" it will keep them logged in for 14 days.
However, I want to keep users logged in for as long as possible once they log in through the kiosk.
I was maybe thinking 1 month.
Is there any limit to how long I can set? Can I set for 2 months? 3 months? 4 months? I know an actual cookie can be set to more than 10 years, but not sure if WP has it's own limitations on that.
I also found a snippet of code to help me set this but I'm not sure how to know if it works, the article I found it from is 2 years old...
// keep users logged in for longer in wordpress
function wcs_users_logged_in_longer( $expirein ) {
// 1 month in seconds
return 2628000;
}
add_filter( 'auth_cookie_expiration', 'wcs_users_logged_in_longer' );
Thank you.