Set and Delete Cookies at CodeIgniter

Share on TwitterDigg This

In codeigniter the Cookie Helper file contains functions that assist in working with cookies.

//load the cookie helper
$this->load->helper('cookie');
$cookie = array(
    'name'   => 'loggedin',
    'value'  => 'yes',
    'expire' => '86500',
    'domain' => '.apol0829.dev',
    'prefix' => 'apollidon_'
    );
set_cookie($cookie);
$cookie = array(
    'name'   => 'loggedin',
    'value'  => '',
    'expire' => '0',
    'domain' => '.apol0829.dev',
    'prefix' => 'apollidon_'
    );
delete_cookie($cookie);

Random

About prabin t p

Connect with me on Google+
This entry was posted in codeigniter, php. Bookmark the permalink.

One Response to Set and Delete Cookies at CodeIgniter

  1. Arthur says:

    Thanks for any other magnificent post. Where else may just anoyne get that kind of info in such a perfect method of writing? I’ve a presentation next week, and I’m at the search for such info.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*