Welcome Guest, Not a member yet? Register   Sign In
check session and redirect to login page
#1

Dear all,

I am making codeiginter php web site. I have login session. But how to check the session login expired and redirect to login page in less code way. I have the header php web page in which I want to code something to achieve this. Do you have any ideas ??
Reply
#2

(01-15-2016, 04:48 AM)rchiu5hk Wrote: Dear all,

I am making codeiginter php web site. I have login session. But how to check the session login expired and redirect to login page in less code way. I have the header php web page in which I want to code something to achieve this. Do you have any ideas ??

The easiest thing for you to do is look at how one of the existing CI auth libraries is doing it. Also, unless you like sitting around for hundreds of hours and making sure you have not introduced any security vulnerabilities into your site, you're better off using one of the existing CI auth libraries.
Reply
#3

Code:
$this->load->library('session');

Code:
if ($this->session->userdata('logged_in')) {

// code statements My Account
else
{
redirect('login', 'refresh');
}
Web Developer
Reply




Theme © iAndrew 2016 - Forum software by © MyBB