Welcome Guest, Not a member yet? Register   Sign In
how to get logged_in session status in native php
#2

(This post was last modified: 06-15-2020, 08:01 AM by neuron.)

Hi,

This is the code I used in some of my project:

update your CI index.php:

PHP Code:
//$system_path = 'system';
$system_path dirname(__FILE__) . DIRECTORY_SEPARATOR 'system';
//$application_folder = 'application';
$application_folder dirname(__FILE__) . DIRECTORY_SEPARATOR 'application'


In your non CI PHP code
Code:
//relative path to CI index.php
include('../../../index.php');
ob_end_clean();
$CI =& get_instance();
$CI->load->driver('session');

//this this index I set with $this->session->set_userdata()
if(@$_SESSION['logged_in'] != TRUE){
    redirect(BASE_URL);
}
Reply


Messages In This Thread
RE: how to get logged_in session status in native php - by neuron - 06-15-2020, 08:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB