What is Cookie?
A cookie is used to store information under a web browser, every browser contains a separate directory to store data under the cookie. The cookie will be private. The session will be stored data under the cookie folder by default.
Step for Cookie:-
1 Load cookie helper in autoload.php
2 first set cookie
$this->input->set_cookie('key','value',time);
$this->input->set_cookie('cuid',$user,3600);
$this->input->set_cookie('cpwd',$pass,3600);
3 get cookie data
$data= array('a'=>$this->input->cookie('cuid'),'b'=>$this->input->cookie('cpwd'));
echo $this->input->cookie('key')
4 delete cookie data
delete_cookie('key');
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOrCBsfAjdwTQxCsSe9_iBH948reOsBwXtZAMnf478Q-a8_CJ2yChzDUv9SAvjSfCE9SWSmgB2rBsA2tGisHyKBnGhg4AfTS1ppU1rZCXDoXdiDxtzYhy7YvqfmbncjEqRb797WCvv_htb/s320/bannerdigital.png)
A cookie is used to store information under a web browser, every browser contains a separate directory to store data under the cookie. The cookie will be private. The session will be stored data under the cookie folder by default.
Step for Cookie:-
1 Load cookie helper in autoload.php
2 first set cookie
$this->input->set_cookie('key','value',time);
$this->input->set_cookie('cuid',$user,3600);
$this->input->set_cookie('cpwd',$pass,3600);
3 get cookie data
$data= array('a'=>$this->input->cookie('cuid'),'b'=>$this->input->cookie('cpwd'));
echo $this->input->cookie('key')
4 delete cookie data
delete_cookie('key');
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOrCBsfAjdwTQxCsSe9_iBH948reOsBwXtZAMnf478Q-a8_CJ2yChzDUv9SAvjSfCE9SWSmgB2rBsA2tGisHyKBnGhg4AfTS1ppU1rZCXDoXdiDxtzYhy7YvqfmbncjEqRb797WCvv_htb/s320/bannerdigital.png)
POST Answer of Questions and ASK to Doubt