CodeIgniter Forums
Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING (/thread-49803.html)



Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING - El Forum - 03-04-2012

[eluser]Unknown[/eluser]
I started creating a custom library that i would load for checking if user is logged in and also for registering users. Registration not started yet, but that's not important...

here's the problematic part.. it WON't set cookies:

Code:
$this->load->helper('cookie');
$some_value= 'asd';
$some_cookie_array = array(
                          'name'   => 'some_name',
                          'value'  => $some_value,
                          'expire' => 86500,
                          'secure' => TRUE
                          );
$this->input->set_cookie($some_cookie_array);
here is the full code for now: codepad.org/FILlq2qR

This is how i call the library and check if user is logged in:

Code:
$this->load->library('user_management');
$login_data = $this->user_management->login();
var_dump($login_data);
Any help is more than welcome!

Cheers!

p.s. I'm new to CI


Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING - El Forum - 03-04-2012

[eluser]InsiteFX[/eluser]
Code:
$some_cookie_array = array(
                          'name'   => 'some_name',
                          'value'  => $some_value,
                          'expire' => 86500,
                          'secure' => FALSE
                          );

secure is only used for https://



Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING - El Forum - 03-04-2012

[eluser]Unknown[/eluser]
thanks a lot!