codeigniter session object expired availability

484 views Asked by At

This might be a silly question.

Once a user has been logged in, if session expires I want to redirect him to a "lockscreen" instead to a "login" page.

I want to send to the lockscreen some session data (like img-src and loginname)

So, here's the question. Does session object is automatically destroyed when expires or is it still available?

Thanks.

1

There are 1 answers

2
AjayR On BEST ANSWER

When Session expires, session variables also becomes undefined. So always check your session like below

    if (isset ($_SESSION['username']))
    {
     // Its active
    }
   else
   {
     // Session expired
   }