Skip to content

Commit e063cbe

Browse files
committed
docs: add about difference in redirec()
1 parent 7f3afe9 commit e063cbe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

user_guide_src/source/installation/upgrade_4xx.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ Helpers
142142
- In CI4, ``redirect()`` is completely changed from CI3's.
143143
- `redirect() Documentation CodeIgniter 3.X <https://codeigniter.com/userguide3/helpers/url_helper.html#redirect>`_
144144
- `redirect() Documentation CodeIgniter 4.X <../general/common_functions.html#redirect>`_
145-
- In CI4, ``redirect()`` returns a ``RedirectResponse`` instance instead of redirecting and terminating script execution. You must return it.
145+
- In CI4, :php:func:`redirect()` returns a ``RedirectResponse`` instance instead of
146+
redirecting and terminating script execution. You must return it from Controllers
147+
or Controller Filters.
148+
- Cookies and Headers you set before calling ``redirect()`` are not automatically
149+
carried over to a ``RedirectResponse``. You need to call ``withCookies()``
150+
or ``withHeaders()`` manually if you want to send them.
146151
- You need to change CI3's ``redirect('login/form')`` to ``return redirect()->to('login/form')``.
147152

148153
Hooks

0 commit comments

Comments
 (0)