0
사용자 로그인과 로그 아웃/세션 만료 정보를 데이터베이스에 추가하고 싶습니다. 정상적인 로그인과 로그 아웃은 쉽지만 진행 방법을 알 수는 없습니다 자동 세션 만료.Zend Auth에서 사용자 세션이 만료되었을 때 만료 시간을 기록하는 방법
내 인증은 다음과 같이 작동합니다.
내 로그인 컨트롤러 액션 나는이를 수행 할 핵심 PHP 나 젠드 기능이 없다는 것을 두려워
function authenticate($email, $password) {
$where = array();
$where[] = $this->getAdapter()->quoteinto('email = ?', $email);
$user = $this->fetchRow($where);
if (isset($user['email'])) {
$salt = $user['password_salt'];
if (sha1($password . $salt) == $user['password']) {
/** here i will add login session info**/
return $user;
}
return false;
}
return false;
}
사용자가 실제로 로그 아웃하지 않으면 세션의 마지막 타임 스탬프를 확인하기 위해 다른 HTTP 요청이 필요합니다. 그러나 세션이 20 분 동안 지속되면 해당 기간 내에 새로 고쳐지지 않은 세션은 더 이상 활성화되지 않으며 정기적으로 데이터베이스 레코드를 업데이트 할 예정입니다. – AlexP