2
Take a look at this answer from Programmers.SE:
http://programmers.stackexchange.com/questions/46716/what-technical-details-should-a-programmer-of-a-web-application-consider-before
Then look under: Security
It's a very good answer in general and it's very detailed.