title: How to check when user visited(been active) the site last time
body: <p>Been looking for a solution for hours and didn't found one 
  I've tried to use the following code</p>
  
  <pre><code>function user_last_login( $user_login, $user ){
  update_user_meta( $user-&gt;ID, '_last_login', time() );
  }
  add_action( 'wp_login', 'user_last_login', 10, 2 );
  </code></pre>
  
  <p>but I figured out that wp_login action hook only triggered when user logs in manually (writing the username and the password and clicking log in) and it's not triggered if he's logged in automaticly ...</p>
  
  <p>Another thing I've tried was this code </p>
  
  <pre><code>add_action('init', 'wpse_session_start', 1);
  function wpse_session_start() {
     if(!session_id()) {
        update_user_meta( get_current_user_id(), '_last_login', time() );
        session_start();
      }
  }
  </code></pre>
  
  <p>but this one don't do the work too...
  Would be very greatfull somebody can offer a way to solve this issue</p>