1. Sessions are bad. Use cookies.
2. if(!isset($_SESSION['username']) is bad, for a user could create a session called username and the system would log him in without even checking if the user exists. (I know this is kind of hard with sessions, but still.)
3. Use oop.
Needless to say, it's actually the exact opposite as what you said. I assume it was a mistype. Well, To use OOP is good and all, but it's certainly not bad if you use procedural for small web-apps.. How do you suppose one write elegant OOP when one can't even master procedural? You've got to walk before you can crawl now??? It's bad practice to crawl, so all you toddlers, GET WALKIN'! OOP should be learned, it's VERY good to learn and use, but if you can't code functions, then you're not going to grasp OOP. Start with variables, goto conditionals, move onto loops, then goto functions, THEN goto OOP style... That's pushing it, you really should know a whole list of built-in functions first, too.
@other posts
isset() doesn't "protect" anything, if a variable is set, that doesn't make it secure. If you're administration panel is behind "isset" function, that's really funny.. Especially with cookies, that's like the easiest variable to set/change next to GET~ with POST not too far behind. $_SESSION variables WILL NOT be individually set or changed. An entire session key can be generated or stolen, but.. that's so far-fetched, and it assumes the attacked individual is infected with some sort of cookie sniffer, keylogger, or trojan already. (or a victim to the ever-popular, "copy your address bar for free cash!" (in the case the session ID is in GET instead of Cookie, which is hardly less secure except in terms of social hacking idiots.)
It only makes sense to use sessions. If you rely solely on cookies, it's just asking for scary trouble.
Also, with a few simple adjustments... Way[2]Death is so right on it's ridiculous. I have nothing more to say.
