php - cookies get vanished when browser closed in codeiginter -
cookies vanish when close browser. can't see when opene browser again. code is
$this->sesdata = array( 'shop_user' => $username, 'shop_password' => $password, 'logged_in' => true ); $this->ci->session->set_userdata($this->sesdata); $this->cookie = array( 'name' => 'user', 'value' => $username, 'expire' => time()+86500, 'domain' => '', 'path' => '/', 'prefix' => '', ); $this->ci->input->set_cookie($this->cookie); $this->cookie1 = array( 'name' => 'pass', 'value' => $password, 'expire' => time()+86500, 'domain' => '', 'path' => '/', 'prefix' => '', ); $this->ci->input->set_cookie($this->cookie1);
the value of expire should number only. don't add current time value passed number of seconds should persist now. see documentation more details.
Comments
Post a Comment