CodeIgniter Forums
Logout problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Logout problem (/thread-33179.html)



Logout problem - El Forum - 08-18-2010

[eluser]Gowrisankar[/eluser]
Hi...

When i am logout the page backspace is allow to back. I want to disable backspace.
for example when you sign-out gmail that won't allow back.
i need that way to log-out.
I hope anyone help in this forum.....

This is my log-out function coding...
function logout()
{
if($this->session->userdata('uid')!='')
{
$this->session->session_destroy();
redirect('home','refresh');
}
else
{
$this->session->session_destroy();
redirect('home','refresh');
}
}


Logout problem - El Forum - 08-18-2010

[eluser]Gowrisankar[/eluser]
Hi...

When i am logout the page backspace is allow to back. I want to disable backspace.
for example when you sign-out gmail that won't allow back.
i need that way to log-out.
I hope anyone help in this forum.....

This is my log-out function coding...
function logout()
{
if($this->session->userdata('uid')!='')
{
$this->session->sess_destroy();
redirect('home','refresh');
}
else
{
$this->session->sess_destroy();
redirect('home','refresh');
}
}


Logout problem - El Forum - 08-18-2010

[eluser]Gowrisankar[/eluser]
Hi...

When i am logout the page backspace is allow to back. I want to disable backspace.
for example when you sign-out gmail that won't allow back.
i need that way to log-out.
I hope anyone help in this forum.....

This is my log-out function coding...
function logout()
{
if($this->session->userdata('uid')!='')
{
$this->session->sess_destroy();
redirect('home','refresh');
}
else
{
$this->session->sess_destroy();
redirect('home','refresh');
}
}


Logout problem - El Forum - 08-18-2010

[eluser]Deathcode[/eluser]
Try this code....

Code:
function __construct(){
parent::Controller();
$this->is_logged_in();    
}
    
function is_logged_in(){
$is_logged_in = $this->session->userdata('is_logged_in');
        
if(!isset($is_logged_in)||$is_logged_in != True){
echo "You have logout or your session is expired. Please Login again" ;
die();
}
}

but you have to create session/cookies that saved the value of "is_logged_in" on your login controller and destroy it session/cookies when you logout.


Logout problem - El Forum - 08-18-2010

[eluser]minerbog[/eluser]
Please only post in one place. Preferably the right place...

This forum is for bug reports not problems