Answers.Body: <p>Because you can login with either your email address or your username.  And some sites will be <a href="https://craftcms.com/docs/config-settings#useEmailAsUsername" rel="nofollow">forcing</a> the username to be the email address.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-07T01:58:39.380Z
Answers.LastActivityDate: 2016-05-07T01:58:39.380Z
Answers.UserDisplayName: Brad Bell
Body: <p>In the examples they're used mixed: </p>
  
  <p><a href="https://craftcms.com/docs/templating/user-registration-form" rel="nofollow">Registration</a></p>
  
  <pre><code>&lt;input id="username" type="text" name="username"
  {%- if account is defined %} value="{{ account.username }}"{% endif -%}&gt;
  </code></pre>
  
  <p><a href="https://craftcms.com/docs/templating/login-form" rel="nofollow">Login</a></p>
  
  <pre><code> &lt;input id="loginName" type="text" name="loginName"
      value="{{ craft.session.rememberedUsername }}"&gt;
  </code></pre>
  
  <p>For the login form, a field named "username" can not be used, it should be "loginName". What is the difference between the two?</p>
  
Tags: <login><registration>
Title: The difference between username and loginName
ThreadText: # The difference between username and loginName
  
  (Asked by: username_0 on 2016-05-07)
  
  In the examples they're used mixed:
  
  [Registration](https://craftcms.com/docs/templating/user-registration-form)
  
  ```
  <input id="username" type="text" name="username"
  {%- if account is defined %} value="{{ account.username }}"{% endif -%}>
  
  ```
  
  [Login](https://craftcms.com/docs/templating/login-form)
  
  ```
   <input id="loginName" type="text" name="loginName"
      value="{{ craft.session.rememberedUsername }}">
  
  ```
  
  For the login form, a field named "username" can not be used, it should be "loginName". What is the difference between the two?
  
  **Tags:** login, registration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-07. Score: 2 | Accepted answer
  
  Because you can login with either your email address or your username. And some sites will be [forcing](https://craftcms.com/docs/config-settings#useEmailAsUsername) the username to be the email address.
  
  
  ---
  
  