<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 function is_logged_in()
 {
     $ci = get_instance();
     $ci->load->library('session');
     $user_id=$ci->session->userdata('user_id'); 
     if(!$user_id){
          redirect('welcome/login', 'refresh');
     }
     //echo 'yes';exit;

 }
 