title: Symfony3, set user last login date
body: <p>I have a simple login form:</p>
  
  <pre><code>public function loginAction(Request $request)
  {
      $authenticationUtils = $this-&gt;get('security.authentication_utils');
  
      // get the login error if there is one
      $error = $authenticationUtils-&gt;getLastAuthenticationError();
  
      // last username entered by the user
      $lastUsername = $authenticationUtils-&gt;getLastUsername();
  
      return $this-&gt;render(
          'users/login.html.twig',
          [
              'page' =&gt; 'login',
              'last_username' =&gt; $lastUsername,
              'error'         =&gt; $error,
          ]
      );
  }
  </code></pre>
  
  <p>security.yml:</p>
  
  <pre><code>secured_area:
       form_login:
          provider: user_db_provider
          login_path: /login
          check_path: /login
          csrf_token_generator: security.csrf.token_manager
  </code></pre>
  
  <p>And I'm trying to set the user's last login time. </p>
  
  <p>Do I really have to create a new listener and write an entire class, like <a href="https://stackoverflow.com/questions/30054216/execute-function-after-user-login-symfony-2-3">this answer</a>, just for this single instruction: <code>$user-&gt;setLastLogin(new \DateTime());</code>? Or is there something simpler, like putting it in the controller?</p>