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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -