Hey, i know maybe lots of people might have brought this up however i haven't found any good threads about it etc.
I use to use a login script which would do:
session_set_cookie_params($thirdyDays);
session_start();
I would do this when the login was successful and then, it would remember the session info for 30 days and all i had to do was session_start it.
However, it doesn't always work, almost never works in my localhost, it sometimes works in my web server, I tried commenting the session.life_time or whatever, but that didn't help. And you can't always expect the enviornment you're working in to have it commented etc.
I've looked into many membership system classes online such as PHPnuke and they use cookies... by doing something like:
setcookie($cookiename, $username, bla bla bla);
/*then they just check it with the DB: where SQL username would match the cookie Username */
But THis is very unsafe. If some customer did this in an internet cafe and logged in and forgot to logout but closed the window. That would mean the guy has his username for 30 days and can just duplicate a cookie to use ... and access stuff...
What i'm looking for is an intelligent way thats secure and uses mostly sessions... i'm not sure exactly how session_set_cookie_params works; we need a secure way to remember the session id... i'm not sure exactly how... whether its going to be setcookie($name, session_id(), bla bla); or if theres another way to save the information by the "remember me" or "save my username and password" way...
Any info would help. Is cookie the only way? Perhaps a cookie with an IP and then make the customer relogin if he has different IP?