Welcome Guest, Not a member yet? Register   Sign In
sess_destroy() and browser refresh
#1

[eluser]rajend3[/eluser]
My signout function calls sess_destroy() then loads a view through a function I created in a helper class. In my header view I check if uid is set and if it is display a signout button instead of a signin button. When I signout the signout button is still displayed unless I refresh the page. Any ideas on what I'm doing wrong?

Signout function
Quote: public function signout()
{
$this->session->sess_destroy();
load_view("home_view");
}

Load view helper function
Quote:if ( ! function_exists('load_view'))
{
function load_view($content, $data = null)
{
$CI =& get_instance();

if ($CI->session->userdata("uid") !== FALSE)
{
$data["uid"] = $CI->session->userdata("uid");
}


$data["content"] = $content;
$CI->load->view("includes/template_view", $data);
}
}

View:
Quote: <?php if (isset($uid)): ?>
<-a id="signin" class="blueButton" href="http://localhost/index.php/authentication_controller/signout">Sign out</a>
&lt;?php else: ?&gt;
<-a id="signin" class="blueButton" href="http://localhost/index.php/authentication_controller/signin">Sign in</a>
&lt;?php endif; ?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB