Auto login

This topic contains 2 reply and 2 voices, and was last updated by ced 10 years, 6 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
June 28, 2014 at 7:28 pm 22553
ced Hi, I use your snippet for auto login but I need to know how long this cookie will be set. Will it expires when the user will close his browser particulary IE... ?
// auto log in a user who has just signed up      
	function wpufe_auto_login_new_user( $user_id ) {
		wp_set_current_user( $user_id );
		wp_set_auth_cookie( $user_id, false, is_ssl() );
	}
	add_action( 'user_register', 'wpufe_auto_login_new_user' );
June 30, 2014 at 12:45 pm 22600
Sekander Badsha Sekander Badsha

If an user doesn’t select Remember Me, the cookie will last for 2 days. But if the user selects Remember Me, The cookie will last for 14 days. It doesn’t care about how many times the browser is opened or closed.

July 2, 2014 at 1:58 pm 22727
ced ced

Thank you.
Is there a way to limit it to one hour in both case ?

Viewing 2 Posts - 1 through 2 (of 2 total)