• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter 2.1 $this->input->set_cookie($some_var); NOT WORKING

#1
[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

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

secure is only used for https://

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.