a note to
JaWi,
you might want to send the session ID in the cookie and not the username, and keep the username in the db along wih its relative ID or else you'll be vulnerable to cross site attacks.
(someone logs in, and another guy sets his cookie to this guy's username...)