Click here to Skip to main content
15,887,083 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: how not to check a login Pin
Lutosław8-Jul-09 12:39
Lutosław8-Jul-09 12:39 
GeneralRe: how not to check a login Pin
icewolf_snowfire8-Jul-09 15:41
icewolf_snowfire8-Jul-09 15:41 
GeneralRe: how not to check a login Pin
Lutosław9-Jul-09 4:04
Lutosław9-Jul-09 4:04 
GeneralRe: how not to check a login Pin
leppie12-Jul-09 2:15
leppie12-Jul-09 2:15 
GeneralRe: how not to check a login Pin
icewolf_snowfire14-Jul-09 9:32
icewolf_snowfire14-Jul-09 9:32 
GeneralRe: how not to check a login Pin
Lutosław17-Jul-09 10:06
Lutosław17-Jul-09 10:06 
GeneralRe: how not to check a login Pin
MarkB77716-Jul-09 20:20
MarkB77716-Jul-09 20:20 
GeneralRe: how not to check a login Pin
supercat98-Jul-09 13:19
supercat98-Jul-09 13:19 
I'm not sure what's worse, that a professional development company has people who think this is how you use exceptions, or that my company actually paid money for this code Unsure
I love the way they put database errors in the message to the user, and identify which they got wrong, the username or the password.Mad


In many situations, it's entirely reasonable to distinguish a bad username from a bad password. User names are generally not secure, and legitimate users may not always remember which variation of their username they used at a particular site.

Having a login routine throw an exception for user-not-found is not the best, but if a custom exception were used for that purpose, it wouldn't be totally horrible. The only really horrible thing I see is the munging of the exception message.

BTW, one feature I'd like to see on a web site would be an option for users to specify a string that should be displayed on an unsuccessful login attempt, with the instruction that the string should contain something recognizable, but should not contain any security-related information. That would allow someone who mistakenly tries to log in with someone else's username to immediately realize their mistake.
GeneralRe: how not to check a login Pin
Russell Jones13-Jul-09 5:03
Russell Jones13-Jul-09 5:03 
GeneralRe: how not to check a login Pin
supercat914-Jul-09 5:45
supercat914-Jul-09 5:45 
GeneralRe: how not to check a login Pin
Jammer13-Jul-09 6:34
Jammer13-Jul-09 6:34 
GeneralRe: how not to check a login Pin
PaPaSEK13-Jul-09 19:12
PaPaSEK13-Jul-09 19:12 
GeneralRe: how not to check a login Pin
Tristan Rhodes16-Jul-09 1:58
Tristan Rhodes16-Jul-09 1:58 
GeneralRe: how not to check a login Pin
Vozzie25-Aug-09 3:35
Vozzie25-Aug-09 3:35 
GeneralWell verified code Pin
Paulo Zemek7-Jul-09 10:09
mvaPaulo Zemek7-Jul-09 10:09 
GeneralRe: Well verified code Pin
Luc Pattyn7-Jul-09 12:14
sitebuilderLuc Pattyn7-Jul-09 12:14 
GeneralRe: Well verified code Pin
leppie8-Jul-09 3:00
leppie8-Jul-09 3:00 
GeneralRe: Well verified code Pin
Super Lloyd8-Jul-09 4:02
Super Lloyd8-Jul-09 4:02 
GeneralRe: Well verified code Pin
Luc Pattyn8-Jul-09 7:38
sitebuilderLuc Pattyn8-Jul-09 7:38 
GeneralRe: Well verified code Pin
Lutosław8-Jul-09 10:21
Lutosław8-Jul-09 10:21 
GeneralRe: Well verified code Pin
Super Lloyd7-Jul-09 14:24
Super Lloyd7-Jul-09 14:24 
GeneralRe: Well verified code Pin
0x3c08-Jul-09 3:50
0x3c08-Jul-09 3:50 
GeneralRe: Well verified code Pin
Super Lloyd8-Jul-09 3:59
Super Lloyd8-Jul-09 3:59 
GeneralRe: Well verified code Pin
Viral Upadhyay8-Jul-09 4:06
Viral Upadhyay8-Jul-09 4:06 
JokeRe: Well verified code Pin
Jeremy Tierman8-Jul-09 6:30
Jeremy Tierman8-Jul-09 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.