• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sessions not working properly on live server

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');
        if (
$this->form_validation->run() == FALSE) {
$data = array(
'errors' => validation_errors()

        } 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') {
                } elseif (
$_SESSION['user_role']->role_id == '2') {
                } elseif (
$_SESSION['user_role']->role_id == '3') {
            } else {
$this->session->set_flashdata('login_failure''That is an incorrect email/password combination. Please try again.');


Why is this no longer working for me?


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

You should check your server configuration.

This is an example. I don't know it helps you or not:
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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