4 ms·
On the plus side, they're telling people about the limit. I visit so many websites that will happily take passwords of arbitrary length without complaint... unt
by cgriswald 12y ago
On the plus side, they're telling people about the limit. I visit so many websites that will happily take passwords of arbitrary length without complaint... until you try to log in and your password doesn't work because the password you entered was too long and it truncated it.
- jschwartzi 12y agoI have an auto loan with a company which truncates the username. It's bizarre because they'll happily let you key in the entire username when you go to log in, but it truncates when you first set your account up. Why on earth would you ever need to truncate a username?
- mod 12y agoTo keep username from ruining the front-end. If I had a 2,000 character username, this page would look really stupid.
- ChrisGranger 12y agoI saw an example of that on a JavaScript-related site recently, where a guy's username was aaa...aaa several hundred characters long, causing a ludicrous horizontal scroll bar. You'd think it would be easy enough to say upfront during account creation that both usernames and passwords are limited to x characters.
- mike-cardwell 12y agoThat is what this css is for: overflow: hidden; text-overflow: ellipsis;
- reberhardt 12y agoIn addition to the frontend issue mod mentioned, it often happens accidentally without any errors or warnings when using a VARCHAR in a relational database, which have a maximum length. If the username field is VARCHAR(20), the application ignores database truncation warnings, and the developer didn't think to check the username length before storing it in the database, it'll truncate a 21-character username without you knowing. This comes down to the devs using sensible field lengths and handling edge cases.
- desas 12y agoI think mysql is the only database that auto truncates varchars isn't it?
- deleted 12y ago[deleted]
- MichaelGG 12y agoWell, you have to have some limit. Otherwise a user could register with a 1GB username. This might break all sorts of things that assume they can display or work with usernames.
- mike-cardwell 12y agoThis is why you prevent them from entering one that is longer than your limit. You don't let them enter it and then truncate it...
- andrewstuart2 12y agoIt's a pet peeve of mine when a site puts a max length on characters (which is dumb itself) and then they don't put a max length on the password input later. Nothing but a regular workout for your 'forgot my password' feature. It bothers me less now that I use a good password generator/safe, but still bothers me nonetheless.