• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sessions stopped working after 2nd day

#1
[eluser]BigJoe[/eluser]
I watched some video tutorials on creating and register and login for CI. The thing is that every thing was working fine the 1st day. Then the next day I wanted to log in and test some options I added and well it looks like the sessions are not getting set. So I been reading a lot on this matter and I'm confused on this. My code is below. Any one have any ideas why this just stopped working

Code:
public function login_validation() {
        
        $this->form_validation->set_rules('username','Username','required|trim|max_lengh[50]|xxs_clean|callback_validate_user');
        $this->form_validation->set_rules('password','Password','required|trim|max_lengh[150]|xxs_clean|md5');
        
        if($this->form_validation->run()) {
            
            $data = array(
                'username'      => $this->input->post('username'),                
                'is_logged_in'  => 1                
            );
            
            $this->session->set_userdata($data);            
            
            redirect('home/index');
        } else {            
            $this->load->view('login_view');
        }      
    }


#2
[eluser]ramirors[/eluser]
Are you trying with same browser? same server? persist session in database? config.php->compare_user_agent?

#3
[eluser]BigJoe[/eluser]
Sorry, I forgot all about this. The problem was in the config.php file. I had some of the options set wrong. Sorry to have bothered you.

Joe


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.