![]() |
Hello!
I don't know how to describe my problem, because actually everything runs. But not I did the same thing like I did just a few lines later in an other function of my controller, I did not work... I use the cookie-helper to set and get two cookies to identify the user and the device. In the add-function it works. Both cookies are set and I can confirm on all pages that this user is a regular one. Or if not, it redirects as expected. This is, how I set it: PHP Code: set_cookie('device_id', $deviceId, 31536000); The same line, I copyed and pasted minutes ago to be sure, that everything is the same ![]() PHP Code: set_cookie('app_id', $appId, 31536000); $deviceId is filled, the cookie is not. It's totally the same. I moved this lines to the begin and the end of the register-function so be sure, that there happens nothing between the call of the controller/function and the action to set the cookie. PHP Code: public function device($step = NULL, $code = NULL) And the answer is: 23423 # / check # The function a few lines below: PHP Code: public function add() And the answere is: here: b737004617ee83fdd8fe62fb059d734259210b3c I'm confused about this. Same Controller, only different functions. What is going on here? How to use cookie-helper in all functions? ![]()
Cookies do not update until the next page refresh.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thanks, that's it, the page has to refresh, what I do mostly like this
PHP Code: return redirect()->to('/foo')->withCookies(); But in my specal case, without "withCookies()". Add this to my redirect did it ![]() |
Welcome Guest, Not a member yet? Register Sign In |