Home Forums Plugin Support WP User Frontend Pro Auto login

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  ced 4 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22553

    ced
    Participant
    Post count: 32

    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' );
    #22600

    Sekander Badsha
    Member
    Post count: 2067

    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.

    #22727

    ced
    Participant
    Post count: 32

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

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Auto login’ is closed to new replies.