Re: Cookies/Remember Me
This is how I setup a cookie in my login screen:
OnInit:
// so user cannot hit BACK key and gain access from cache
header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”); // Date in the past
header(“Last-Modified: " . gmdate(“D, d M Y H:i:s”) . " GMT”); // Always modified
header(“Cache-Control: private, no-store, no-cache, must-revalidate”); // HTTP/1.1
header(“Cache-Control: post-check=0, pre-check=0”, false);
header(“Pragma: no-cache”); // HTTP/1.0
OnLoad:
// restore from cookie
if (!EMPTY($_COOKIE[“acweb_UserName”])) {
{input_username} = $_COOKIE[‘acweb_UserName’];
}
OnValidate:
// setup username cookie
$expirytime = time() + 3652460*60; // Change cookie expiry time here
ob_start();
setcookie(“acweb_UserName”,$_SESSION[‘g_username’], $expirytime); // Set up user name cookies
ob_end_flush();