Welcome Guest, Not a member yet? Register   Sign In
How to work with cookie and redirect in codeigniter 4
#1

(This post was last modified: 09-10-2021, 05:50 AM by venance.)

Hello everyone. I'm working with codeigniter4 where I want to be able to store cookie and then redirect
to another page. If I set a cookie without including redirection process, Cookie stores successfully, But the issue is when I do redirection, the cookie did't saved anymore.
How can I solve and make cookie saved and redirect

PHP Code:
public function loginProcessor(){
    helper(['cookie']);
    $checkStatus true;

    if ($checkStatus){
        set_cookie('nameCookie''CookieSomething'time() + 60*60*24*30);
    }
    return redirect()->to('dashboard');

Reply


Messages In This Thread
How to work with cookie and redirect in codeigniter 4 - by venance - 09-10-2021, 04:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB