CodeIgniter4: RedirectResponse does not set cookies
Describe the bug
In a Controller, the following code works:
return $this->response->redirect(route_to('admin'))
->setCookie('foo', 'bar', YEAR)
->setCookie('login_time', $login_time, YEAR);
It does not works:
return redirect()->route('admin')
->setCookie('foo', 'bar', YEAR)
->setCookie('login_time', $login_time, YEAR);
CodeIgniter 4 version
4.0.0-alpha.2
Affected module(s)
HTTP
Expected behavior, and steps to reproduce if appropriate
Expected cookies to be set.
Context
- OS: [Debian]
- Web server [PHP]
- PHP version [7.2]
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Fixes #1393: add missing sendCookies() call on Response::redirect() — committed to samsonasik/CodeIgniter4 by samsonasik 6 years ago
- Fixes #1393: add missing send() on response instance of RedirectResponse in CodeIgniter::handleRequest() — committed to samsonasik/CodeIgniter4 by samsonasik 6 years ago
Can finally reproduce. Digging further.