How to keep WordPress logged in permanently

I’m trying to use WordPress as a website CMS for a kiosk. Each kiosk needs a unique username therefore it must be logged in to WordPress.

I believe WordPress does not use Session ID’s therefore how can I ensure the user is never logged out of the site even after X days of inactivity?

Read More

Thanks in advance.

Related posts

Leave a Reply

5 comments

  1. There seems to be mixed accepted answers. First, you should never modify the wordpress core code. Ever. Secondly, per the wordpress developer codex, the “auth_cookie_expiration” filter is what needs to be used here.

    add_filter ( 'auth_cookie_expiration', 'wpdev_login_session' );
     
    function wpdev_login_session( $expire ) { // Set login session limit in seconds
        return YEAR_IN_SECONDS;
        // return MONTH_IN_SECONDS;
        // return DAY_IN_SECONDS;
        // return HOUR_IN_SECONDS;
    }
    
  2. I’ve actually created a plugin to deal with this very issue. It uses the idea of persistent login to actually keep users logged into your wordpress website all the time, kind of link how Facebook does it.

    Check it out, hope it helps!

    WP Persistent Login

  3. You can use the plugin “WP Login Timeout Settings” to achieve this. Under “Settings → Login timeout”, it then allows you to configure the login timeout for both a normal login and one with the “Remember Me” box ticked.

    That’s just the same as what the “configure-login-timeout” plugin does, which was already recommended. Just that “WP Login Timeout Settings” seems to be a bit more actively maintained at the moment.