PDA

View Full Version : PHP keep login details



zero_one
October 27th, 2006, 02:14 PM
Hi

I'm doing this site where a user logs in with a username and password... My problem is that as soon as the user closes the browser, (tested on FF and IE) his login details are lost and has to log in again next time he visits the site.
(if the user leaves the site, keeps the same browser window open and then goes back to the site, the login is still there)

so i'm thinking that when the browser closes it's deleting the session variables. any idea how this can be solved?

my sessions are created:



session_cache_expire(300);
$cache_expire = session_cache_expire();

ini_set("session.gc_maxlifetime", "18000");

session_start();

header("Cache-control: private");

binime
October 27th, 2006, 03:42 PM
when they logon store a cookie and a pass hash. then next time they access the site check for the cookie and pass hash if they match, log on, if not ask to login

Seb Hughes
October 27th, 2006, 04:40 PM
Its not a good idea to keep them when they close the sessions. Its saftey reasons.

Binime your footer is tooooo big max 300 * 60

hl
October 27th, 2006, 07:44 PM
If you want a "remember me" function you just use a cookie.

zero_one
October 31st, 2006, 04:11 PM
when they logon store a cookie and a pass hash. then next time they access the site check for the cookie and pass hash if they match, log on, if not ask to login

thanks.