Symfony 1.4-AJAX请求阻止自动注销用户

Symfony 1.4-AJAX请求阻止自动注销用户,ajax,request,symfony1,Ajax,Request,Symfony1,我正在使用Symfony 1.4和Doctrine。我还使用了sfDoctrineGuardPlugin,我想使用“自动注销”功能,但网站上的AJAX请求似乎总是覆盖$this->lastRequest变量,因此它永远不会达到“timeout”值,用户也永远不会被注销 if(false!=$timeout&&null!=$this->lastRequest&&time()-$this->lastRequest>=$timeout){ 如果($this->options['logging']){

我正在使用Symfony 1.4和Doctrine。我还使用了sfDoctrineGuardPlugin,我想使用“自动注销”功能,但网站上的AJAX请求似乎总是覆盖$this->lastRequest变量,因此它永远不会达到“timeout”值,用户也永远不会被注销

if(false!=$timeout&&null!=$this->lastRequest&&time()-$this->lastRequest>=$timeout){
如果($this->options['logging']){
$this->dispatcher->notify(新的sfEvent($this,'application.log',array('Automatic user logout due to timeout'));
}
$this->getGuardUser()->setOnline(0);
$this->getGuardUser()->save();
$this->setTimedOut();
$this->setAuthenticated(false);

}
您的代码不显示如何设置
$this->lastRequest。