• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with cookie not setting

#1
Exclamation 
Good day all, I followed the instruction in the documentation ot setting cookie, it does not work.

After checking through the cookie code, I discovered issue 1 that the sendcookie method is sent after the body is returned. Which makes the method inaccessible. 2 even when the sendcookie method is brought forward, and is accessible, the content of the 
Cookies array is empty.
Reply

#2
Providing example code is always good. Setting it on the response should be all that's needed:

Code:
$this->response->setCookie()
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
Reply

#3
CodeIgniter 4 rc.1 does not send cookies where controller response is redirect?

PS: Sorry, I do not have a full test, but I have a user authentication component where only native PHP method setcookie() is working.
https://github.com/denis303/codeigniter4...ervice.php
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.