Welcome Guest, Not a member yet? Register   Sign In
Session Class -> sess_destroy not removing session
#11

[eluser]CroNiX[/eluser]
Code:
$is_logged_in = $this->session->userdata('is_logged_in');

            //if its not set and if not true, redirect to public pages
            if(!isset($is_logged_in) || $is_logged_in !== TRUE)
            {
                redirect('web_public/index');
                die();
            }
You might want to reread the session user guide on what the class will return if a session variable does NOT exist. Your code is checking to see if the variable is set, which it always will be because the function returns boolean FALSE if it doesn't exist.
#12

[eluser]CroNiX[/eluser]
[quote author="Bart v B" date="1371055551"]
Code:
if(!isset($is_logged_in) || $is_logged_in !== TRUE)
            {
                redirect('web_public/index');
                die();
            }
Why in the world are you letting your script go dead?
die() stops everything. An exit() should be better here.[/quote]

In PHP, exit() === die(). Check the PHP userguide. They reference each other.

http://php.net/manual/en/function.die.php
Quote:This language construct is equivalent to exit().
Quote:die — Equivalent to exit

http://www.php.net/manual/en/function.exit.php
Quote:Note:

This language construct is equivalent to die().




Theme © iAndrew 2016 - Forum software by © MyBB