Welcome Guest, Not a member yet? Register   Sign In
Logout method not called in firefox
#1

[eluser]Unknown[/eluser]
My home controller has following code

class Home extends CI_Controller {

public function index()
{
$user = $this->session->userdata('user');

$data = array();

$this->template->write('title', 'Welcome');
$this->template->write_view('content', 'home', $data, true);

$this->template->render();
}

public function logout()
{
$this->session->unset_userdata('user');
$this->session->sess_destroy();
redirect(site_url('home'), 'refresh');
}
}


AND MY LOGOUT URL IS : home/logout

In all browser this is working except mozilla firefox..

I had read many forum and blogs but could not fixed this issue..

Can any one help me ?


#2

[eluser]Narf[/eluser]
I'd try not using the "refresh" type of redirect. Also, if you're going to destroy a session - you don't need to use unset_userdata() before that.
#3

[eluser]Beginers[/eluser]
try not to include the site_url on your redirect i dont know if that works. just try
usually i used that method.

Code:
redirect('home');
#4

[eluser]alexwenzel[/eluser]
[quote author="Beginers" date="1350641232"]try not to include the site_url on your redirect i dont know if that works. just try
usually i used that method.

Code:
redirect('home');
[/quote]


Code:
redirect('home');

Code:
redirect('controller/method');

This is the only right way. Any other way is wrong.
#5

[eluser]Narf[/eluser]
[quote author="alexwenzel" date="1350648823"][quote author="Beginers" date="1350641232"]try not to include the site_url on your redirect i dont know if that works. just try
usually i used that method.

Code:
redirect('home');
[/quote]


Code:
redirect('home');

Code:
redirect('controller/method');

This is the only right way. Any other way is wrong.[/quote]

That's not true - you can redirect to whatever you like.
#6

[eluser]Beginers[/eluser]
i know that's not the only way to redirect a function
what i mean is that sense vasim has an index function he can do that using

Code:
redirect('home') // i prefer to use this to make the url clean;

or

redirect('home/index');

do not include the site_url on your redirect function




Theme © iAndrew 2016 - Forum software by © MyBB