Welcome Guest, Not a member yet? Register   Sign In
input->set_cookie or setcookie not work
#5

[eluser]helloworld7[/eluser]
I tried two ways.

1) $cookie = array('name' => 'sual', 'value' => 'test', 'expire' => time()+3600,
'domain' => '.somedomain.com', 'path' => '/', 'secure' => TRUE);
$this->input->set_cookie($cookie);
on a controller (A) then redirect to another controller (B)

2) setcookie("TestCookie", 1, time()+3600);
on a controller (A) then redirect to another controller (B)


Then controller (B) just print_r($_COOKIE);

Both ways always just print out only PHPSESSIONID like this.

Array ( [PHPSESSID] => lqcorhnpisl842fk0mrqpkist0 )

And I keep hitting refresh on B and there's only the id.

Should these from config.php matters? I just keep it as the default.

$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;

I don't know what else to check. Hope anyone can help me on this. Thanks.


Messages In This Thread
input->set_cookie or setcookie not work - by El Forum - 07-21-2011, 03:10 PM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 02:27 AM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 07:30 AM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 08:42 AM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 02:44 PM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 03:03 PM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 03:42 PM
input->set_cookie or setcookie not work - by El Forum - 07-22-2011, 07:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB