Firstly, Validating the username and password in the database. Once that is done, In order to track the user (the main place where most hackers get successful)
We can set 2 cookies.
1> Member ID
2> MD5( REMOTE_IP and USER-AGENT and USERNAME and SALT )
Any hacker who tries to obtain session ID or even tries to setup a fake cookie with ID, will have to take additional pain to determine the IP address of the target. Not only that, he will have to even fake User-agent which has details of OS and Browser. SALT can be anything, Its just there for added security. So that a member who comes to know bout this trick, Should not be able to generate his own MD5 Key.
FOR ADDED SECURITY, We can make use of SESSION ID and use it to validate the cookie. Then the data in the Cookie would be,
MD5( REMOTE_IP and USER-AGENT and USERNAME and SALT and SESSION-ID )
and the SESSION can contain the member information bit.
What do you think?
[This concept can be used with PHP / JSP / ASP or any other scripting language]

