Cookies not keeping their values - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Cookies not keeping their values (/showthread.php?tid=54001) |
Cookies not keeping their values - El Forum - 08-17-2012 [eluser]jvicab[/eluser] Hi everyone: Problem: I am not getting the values that are suppossed to be stored on cookies. Notes: - I am using CI session stored in the DB (settings in config.php): Code: $config['sess_cookie_name'] = 'session'; - I have a commom controller from which all my controllers inherit. Logic: I am setting two cookies in my login function (with native setcookie php function) to store email and password values if the checkbox "remember me" in the login form is checked. Code: $email = $this->input->post('email'); - I checked that I am getting values for $email, $password and the if is already entering in its "true" section. I read those cookies in my common controller but they are always empty. Code: $this->RememberedEmail = $this->input->cookie('rmemail'); Any idea why? Thanks in advance for the help. Cookies not keeping their values - El Forum - 08-18-2012 [eluser]InsiteFX[/eluser] 1) Check to make sure that your time is correct. 2) Cookie name: Code: $config['sess_cookie_name'] = 'unigue'; // do not use session. 3) Each cookie should have it's own name. 4) You do not need two cookies, you can store and array or json in a cookie. Code: $data = array( |