...
 
Commits (2)
......@@ -243,15 +243,13 @@
$token = $_COOKIE["login"];
date_default_timezone_set('Asia/Bangkok');
$now_time = date("Y-m-d H:i:s",time());
// echo $now_time;
// echo getTokenExpiredTime($token);
if (isTokenExist($token) and ($now_time < getTokenExpiredTime($token))){
// echo $token;
if (isTokenExist($token) and ($now_time < getTokenExpiredTime($token))) {
return TRUE;
} else{
} else {
return FALSE;
}
} else{
} else {
return FALSE;
}
......
......@@ -16,7 +16,10 @@
}
$id = getUserID($username);
addToken($token, $id);
setcookie("login", $token, time()+86400,"/");
// Cookie with secured connection
setcookie("login", $token, time()+86400, "/", $secure=true, $httponly=true);
header("Location: ../browse");
}
?>
\ No newline at end of file