Ich versuche nach angemeldet aktuellen Seite zu umleiten, mit CakePHP 3.4, aber ich bin wie dieserAnmelden Umleitung in CakePHP 3.4
localhost Seite immer nicht funktioniert, locahost Seite umleiten zu viele mal. Versuchen Sie, Ihre Cookies zu löschen
für 2 Sekunden danach wird es auf die Startseite umleiten. Bitte helfen Sie mir hier draußen. Hier mein Code
In appController.php
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
$this->loadComponent('Auth', [
'authorize' => ['Controller'],
'authenticate' => [
'Form' => [
'fields' => [
'username' => 'email',
'password' => 'password'
],
'scope' => ['userStatus' => '1']
]
],
'loginAction' => [
'controller' => 'Users',
'action' => 'login'
],
'unauthorizedRedirect' => $this->referer(),
'logoutRedirect' => [
'controller' => 'Users',
'action' => 'login'
]
]);
}
In loginController.php
function login{
if ($this->request->is('post')) {
if ($this->Auth->login())
{
$this->redirect($this->referer());
}
else {
$this->Flash->error(__('Your username or password is incorrect.'));
}
}
}
Ihnen sehr danken. Nun funktioniert alles gut, aber NULL Abfrageparameter-String erhalten, obwohl übergeben Abfrage Parameter-String wie diese "Login? Redirect =% 2Farticles% 2Fadd". Hast du eine Ahnung, wo es falsch wäre? – Ashok