Welcome Guest, Not a member yet? Register   Sign In
After sess_destroy(), sess_read() still remains TRUE in View
#1

[eluser]Genki1[/eluser]
PROBLEM:

In my controller, I unset a session->userdata variable, destroy the session, and then load a View. In the view, the supposedly "unset" variable is still set! And, session->sess_read() is still True!

If I refresh the browser window, the variable and session status are updated and correct.

Why? How to correct this?

SOURCE CODE:

Here is the controller (index.php/users/logout):

Code:
<?
class Users extends Controller {
    function logout()
    {
        $this->session->unset_userdata('full_name');
        $this->session->sess_destroy();
        $this->load->view('users/users_logout');
        return;
    }
}
?>

this is the View, "users_logout.php"
Code:
<?
echo '<p>full_name='.$this->session->userdata('full_name');
echo '<p>sess_read='.$this->session->sess_read();
?&gt;

RESULT:

full_name=Joe Smith
sess_read=1

WHAT I'M TRYING TO ACCOMPLISH:
1. When user clicks "logout" link, then
2. System goes to controller "Users", kills the session, and displays a view.
3. In the view, if user is logged in, display "Welcome, username". If user is logged out, don't display username.

So, in my view, I need determine if the session is active or not.
#2

[eluser]Thorpe Obazee[/eluser]
I don't think we have the same problem but I think they are similar.

http://ellislab.com/forums/viewthread/94981/
#3

[eluser]Genki1[/eluser]
Yes, same issue.




Theme © iAndrew 2016 - Forum software by © MyBB