GirishR, good post. One of the things you want to think about is that connection between your site's visitor (via his browser) and your web server/db. Unless you are using SSL to encrypt the tunnel, it's still possible for someone to user a packet sniffer to capture cleartext usernames/passwords.
I'm not sure what your logic is behind authenticating a user against credentials stored in the db AND then registering his password as a session variable. It should be good enough to just register his username or userID as a session variable.
One of the ways I've approached this problem is in the table I use for users, I have a column which I call "permissionLevel". In that column, I assingn a number between 1 and 7 where 1 is considered an anonymous user and 7 is considered a superuser.
I register the visitor's username and his permissionLevel each as a session variable. Then when he comes to a page that requires a user to be logged on (and have certain permissions to do something or look at archives), the logic checks:
- is a username set?
- is the permissionLevel number set and if yes, is it high enough to allow the user to be at this page?