redirect() function clears out any set_cookie - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: redirect() function clears out any set_cookie (/showthread.php?tid=76731) |
redirect() function clears out any set_cookie - burgoyn1 - 06-14-2020 If you set a cookie, then redirect to another page, the cookie does not get set. This used to work in codeigniter 3. PHP Code: helper( 'cookie' ); If you set the cookie without the redirect, it works. PHP Code: helper( 'cookie' ); Also, if you use the built in php setcookie function, it works as expected PHP Code: setcookie( 'my_new_cookie', 'this is some cookie text', time() + 60 * 60 * 24 * 7, '/'); |