I did this elaborate Web app in a short time, and it involved me rolling my own login system for the first time. I worked really really hard on the whole project, doing 90 hours in just 10 days (on top of my regular 8-hour shifts).
The system was set up to send temporary, made-up passwords to everyone who had a registered email address. Once you got your temp password you could log in and easily use a form to change your password to something memorable.
The site was launched and there was a bug. When looking at the bug, I noticed the user in question, who had already signed in once, didn’t have a password in the database. His value for password was blank.
I thought this was kind of weird, since you need a password to log in and the guy had logged in. That’s how we found the bug I was fixing. But, I blew it off, thinking one of the site admins messed up somehow.
About a MONTH later, the project manager told me that someone complained that they kept having to get a temp password every time they logged in. I looked at the database and saw that the only people who had passwords were people who had the random temp passwords. Everyone else had null or blank.
I couldn’t figure out how/why this was automatically happening. I looked at all my code and couldn’t find it.
Until I looked at the “Change Password” form. When I was building the app, I was having problems making Firefox not pre-fill the password field. So in a last-ditch effort I put all sorts of code in there to make sure that password field would be blank. I couldn’t make it blank on load, but I left all the code in there anyway.
But in all my efforts to make it blank, I also managed to make the password field blank on submission. So someone would come to the page, type in their new password, submit it, the code would make the value of the field blank and then submit it.
Everyone who had gone to change their password, then, had made their password blank.
Of course, no one thought to report this within a month and no one had thought to report that they had used the Change Password form before getting “locked out.”
Still, it was totally my fault, and I really screwed the pooch on the crux of this application. if (!IsPostBack) is truly, truly your friend 