I use this function to add cookie and it adds perfectly as I can see in browser options.
function login($username,$password){
$cookieUsername = array(
'name' => 'user',
'value' => md5($username),
'expire' => time()+1000,
'path' => '/',
'secure' => TRUE
);
$cookiePassword = array(
'name' => 'pass',
'value' => $password,
'expire' => time()+1000,
'path' => '/',
'secure' => TRUE
);
$this->input->set_cookie($cookieUsername);
$this->input->set_cookie($cookiePassword);
}
I am unable to get back the cookie from this function:
echo $this->input->cookie('user');
Please help - how can I get cookie back from CodeIgniter?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…