Welcome Guest, Not a member yet? Register   Sign In
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()
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




Theme © iAndrew 2016 - Forum software by © MyBB