I want to let user be able to choose when they login, whether they want to be remembered for 30 days or for the session only. I a bit new to PHP programming
So far i have this:
HTML code:
[code]Remember me for:
auth.php class:
[php]function userloggedin($rr)
{
global $logged_in;
global $userid;
global $sessionid;
global $email;
global $password;
global $autologin;
global $firstname;
global $lastname;
$saltpassword = $password . "5138hyh8g0ghg3g5h";
$encpassword = hash('sha256', $saltpassword);
$logged_in = true;
$userid = $rr->userid;
$firstname = $rr->firstname;
$lastname = $rr->lastname;
setcookie("userid", $userid, time()+60*60*24*30);
setcookie("email", $email, time()+60*60*24*30);
setcookie("password", $password, time()+60*60*24*30);
setcookie("autologin", $autologin, time()+60*60*24*30);
setcookie("firstname", $firstname, time()+60*60*24*30);
setcookie("lastname", $lastname, time()+60*60*24*30);
header('Location: index.php');
}[/php]
Please help on how to accomplish this. Your help will be appreciated.