php - I am unable to maintain sessions on Lite Speed server -


i on hosting plan gives me services of litespeed server. have web application have developed in php codeigniter , tested on localhost happened run apache. same coding unable use application on live server keep me on login page. should log me in , take me dashboard doesn't. redirects me login page again. have checked holds data in session short instance of time , remove it. hence sessions aren't maintained , not letting me log in application. have checked same code on live server running on apache , works fine. let me know solution. here controller code.

defined('basepath') or exit('no direct script access allowed'); class dashboard extends ci_controller {  public function __construct(){     parent::__construct();     $this->load->model('user_model'); } public function index(){     $this->showdashboard();      } private function showdashboard(){    // echo "here"; die;     if($this->session->has_userdata('is_logged_in') && $this->session->userdata('is_logged_in') !== false){         $this->load->view("dashboard");     }     else{         $this->load->view('login_form');     }            } public function load(){     $this->load->library('form_validation');     $this->form_validation->set_rules('user_name', 'user name', 'trim|required');     $this->form_validation->set_rules('password', 'password', 'trim|required');     if ($this->form_validation->run() == false){         $this->load->view('login_form');     }     else{                            $user_name = $this->input->post("user_name");         $password = md5($this->input->post("password"));         if ($this->verifyuser($user_name, $password)){             $user_detail = $this->user_model->getuserdetail($user_name);             $session_data = array(                 'user_id' => $user_detail['user_id'],                 'user_name' => $user_detail['user_name'],                 'display_name'  => $user_detail['display_name'],                 'is_logged_in'  => true,                 'user_role' => $user_detail['user_role']             );         $this->session->set_userdata($session_data);         }         else{             $this->session->set_flashdata('error_msg', 'user , password not match!');         }         redirect('dashboard');     } } private function verifyuser($user_name, $password){     $user_data = $this->user_model->checkuser($user_name, $password);     return $user_data; } public function logout(){     $session_items = array('user_name', 'display_name', 'is_logged_in', 'user_role');     $this->session->unset_userdata($session_items);     redirect('dashboard'); } 

}


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -