"I do want to write secure code, where do I start?..."
That's great! If someone already wants to spend her time/money/resources [which are aparently all the same] building more secure software then it could be considered already as a great start. To me, application security is not different from other application feature - really it is not. And if you adopt this approach then it is easy to handle it throught the dev projects lifecycle - no matter where the project currently is [planning, architecture, coding etc.]. If you treat Security as a feature then you can apply your skills of treating any other features, e.g. requirements, designing, building, testing, deploying, maintaining.
"Right, security is a feature. I do not get it... Is it authN, authZ, SSL, firwall?".
Who asked that? This is great question. And we do have great answer and it is Security Frame that consists of ten items [follow the link, and do not forget to check on the page's rating]
Now I guess it is much easier to handle App Security through the dev lifecycle what it has flesh and blood.
"So, where do I start?".
Oh, right...From Security Engineering perspective there is something to assist you in each project's phase. That "Something" usually consits of guidance content, checklists, and how-to's [there are actually lots more..] - start here.
Enjoy