私は真偽セッションが期限切れにならないという問題があり、これは真偽の私のコードです:Zend Frameworkに2:設定されたセッションの真偽タイムアウト
$adapter = $this->getServiceLocator()->get('doctrine.authenticationadapter.orm_default');
$adapter->setOptions(array(
'objectManager' => $this->getEntityManager(),
'identityClass' => 'Application\Entity\User',
'identityProperty' => 'email',
'credentialProperty' => 'password'));
$adapter->setIdentityValue($mail);
$adapter->setCredentialValue($password);
$authService = new AuthenticationService();
$result = $authService->authenticate($adapter);
if ($result->isValid())
{
$identity = $result->getIdentity();
$authService->getStorage()->write($identity);
echo "valide";
}
else
echo "invalide";
感謝。
すべてのコードを自分で作成しましたか?そうでない場合は、どの外部モジュールを使用していますか?あなたの設定( '/ config/autoload/*')ではどんなモジュール設定でもセッション設定がありますが、どのモジュール設定でも '' Module.php''で余分な設定はどうですか? –
@ThomasDutrionセッション設定や認証については何もありませんconfig。 – user3911183
これは、PHPの基本設定から来ている可能性があります。 –