Welcome Guest, Not a member yet? Register   Sign In
Sessions not working properly on live server
#1

I am building my CI application locally using XAMPP and all was well, so I decided to upload it to my hosting provider's server to demo it to my client.

I had problems with SESSIONS. I checked and fixed file and directory permissions, tried setting $config['sess_save_path'] to a cache directory with no luck, so I switched to database sessions and set up a ci_sessions table in my database. That got me as far as my login form (the index method in my Users.php controller), but when I logged in, I got the message 'No input file specified'.

Here is my login method from my Users.php controller:

PHP Code:
public function login() {
        
        
$this->form_validation->set_rules('email''Email Address''trim|required|valid_email');
        
$this->form_validation->set_rules('password''Password''trim|required|min_length[3]');
        
        if (
$this->form_validation->run() == FALSE) {
            
            
$data = array(
                    
'errors' => validation_errors()
                    );
            
$this->session->set_flashdata($data);        

            
redirect('users');
            
        } else {
            
            
$email $this->input->post('email');
            
$password $this->input->post('password');
            
            
$user_id $this->user_model->login_user($email$password);
                    
            if (
$user_id) {
                
$_SESSION['user_id'] = $user_id;
                
$_SESSION['logged_in'] = true;
                
$_SESSION['user_role'] = $this->user_model->get_user_role($user_id);
                
                
$this->session->set_flashdata('login_success''You are now logged in');
                
                if (
$_SESSION['user_role']->role_id == '1') {
                    
                    
redirect('admin/administrators');
                    
                } elseif (
$_SESSION['user_role']->role_id == '2') {
                    
                    
redirect('careplanners');
                    
                } elseif (
$_SESSION['user_role']->role_id == '3') {
                    
                    
redirect('coordinators');
                    
                }
                
            } else {
                
                
$this->session->set_flashdata('login_failure''That is an incorrect email/password combination. Please try again.');
                
                
redirect('users');

            }
            
        }
        
    } 

Why is this no longer working for me?
Reply
#2

(This post was last modified: 11-17-2015, 09:47 PM by Bhavesh.)

Hi

Change $config['sess_save_path'] = NULL; to $config['sess_save_path'] = '' in config.php file

if error not resolved than please paste here your error or attach screen shot for error.

So I can help you
Reply
#3

You should check your server configuration.

This is an example. I don't know it helps you or not:
https://wiki.magento.com/display/m1wiki/...+specified
Reply




Theme © iAndrew 2016 - Forum software by © MyBB