Welcome Guest, Not a member yet? Register   Sign In
Can not set cookie in ci4
#1

unable to set and get cookie in ci4
PHP Code:
if(! $this->response->hasCookie('test'))
        {
            $cookie = [
                    'name'   => 'test',
                    'value'  => 'The Value',
                    'expire' => '86500',
                    'path'   => '/',
                    'secure' => TRUE,
                    'httponly' => FALSE
            
];
            
            $show 
$this->response->setCookie($cookie);
            echo 'cookie set!';
        
Reply




Theme © iAndrew 2016 - Forum software by © MyBB