こんにちは私はログインセッションがタイムアウトした場合に私がこのようにリクエストを保存するウェブサイトを持っています
Abc::saveThisUrl($this->getRequest());
public static function saveThisUrl($url) {
$lastPg = new Zend_Session_Namespace('history');
$lastPg->url = $url;
}
ログインに成功した後、実行したい
public static function getSavedUrl() {
$lastPg = new Zend_Session_Namespace('history');
if(!empty($lastPg->url)) {
$path = $lastPg->url;
$lastPg->unsetAll();
return $path;
}
return ''; // Go back to index/index by default;
}
だから私のAbcController.phpで
public loginAction()
{
...//login succesfull
//i tried
$request = Abc::getSavedUrl(); /* @var $request Zend_Controller_Request_Abstract */
$this->setRequest($request);
$this->dispatch($request);
//or
$this->run($request->getRequestUri());
//also tried
$front = Zend_Controller_Front::getInstance();
$front->setRequest($request);
return $front->dispatch($request);
}
両方とも機能しませんでした。POSTクエリも実行できる必要があります。インターネット上の多くのソリューションはURLのみを考慮しています。