I've been reading a lot abut this in the last month, and I've tried many different stuff, and I've heard many different opinions.
In the total ignorance in this subject, I've started building a custom session handler in PHP, running a validation script in every page, that was checking if the following conditions saved in $_SESSION were true (all them are hashed in MD5):
1) IP equal to the last used in the last page 2) Browser equal to the last used in the last page
And I had a custom session timeout, specified in the login, that was just allowing me to stay for example 5 minutes logged in. I was regenerating the id too, every page.
I've entered in a #php irc channel, and someone called me crazy for trying to replicate the php pre-defined functions to do all this, and said me just to setup the PHP variables (session.max_time, etc) to the limits, and it would be enough.
I've setup it, but it worked in some servers (localhost and webserv), others seem to be ignoring it.
A teacher of mine said me to use database session validation. One more time, people in irc called me crazy for wasting a lot of memory each time that the page was loaded by making just a connection to validate that stuff.
C'mon, I really don't know what is the right choice, what to follow.
Any advices?