I've been trying this over a week and its driving me crazy. I have a login page on https and rest of the website on normal http. I set the cookie of username and password on the login page.
Code: Select all
setcookie("Remember_Cookies[username]", $txtusername, $time + 2592000); // Sets the cookie username for one month
setcookie("Remember_Cookies[password]", $txtpassword, $time + 2592000); // Sets the cookie password for one monthCode: Select all
if(!empty($logout))
{
$_SESSION['USER'] = "";
$_SESSION = "";
@session_destroy();
if(isset($_COOKIE['Remember_Cookies'])) // If the cookie 'Remember_Cookies is set, do the following;
{
$time = time();
setcookie("Remember_Cookies[username]",'', $time - 2592000);
setcookie("Remember_Cookies[password]",'', $time - 2592000);
}Thanks in advance.