Welcome Guest, Not a member yet? Register   Sign In
Cookie problem
#1

[eluser]sojic[/eluser]
This code "do not write" cookie

Code:
if ($this->input->post('search')) {
            $keyword = urlencode($this->input->post('search'));    
            set_cookie('search', $keyword);
        }
        else {
            $keyword = $this->input->cookie('search');
        }

Also I try

Code:
$keyword = get_cookie('search');

I have autoload "cookie" helper.
#2

[eluser]Unknown[/eluser]
From User Guide:
Code:
set_cookie($name, $value, $expire, $domain, $path, $prefix);
Only the name and value are required.
To delete a cookie set it with the expiration blank.
Your
Code:
set_cookie('search', $keyword);
Alias of
Code:
delete_cookie('search');




Theme © iAndrew 2016 - Forum software by © MyBB