<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>

CC BY-SA 3.0
2016-05-07T01:58:39.380Z
2016-05-07T01:58:39.380Z
Brad Bell
<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>

<login><registration>
The difference between username and loginName
# The difference between username and loginName

(Asked by: username_0 on 2016-05-07)

In the examples they're used mixed: 
Registration


Login
 

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.


---

