Welcome Guest, Not a member yet? Register   Sign In
CI Routing to default, when function is available
#1

[eluser]TimoTimo[/eluser]
Hi, I'm using code igniter for a website, I'm in the building process, and everything works brilliant...except the logout function.

I routed /uitloggen (logout in Dutch) to the login/logoff function.

Code:
$route['uitloggen'] = "login/logout";

The function looks like this:

Code:
function logout()
{    
$this->session->unset_userdata();
$this->session->sess_destroy();

$this->load->helper('url');
redirect('/home', 'location', 301);
}

Testing made clear, that the function is - sometimes - found, but most of the time, it will just redirect to the 'default_controller'.

CodeIgniter documentation showed me this:

Quote:This route indicates which controller class should be loaded if the URI contains no data, which will be the case when people load your root URL.

But obviously this isn't the case, so I hope someone can help me out here, the site where this is hosted is here: www.sollicitatievideoclip.nl
By the way: I was just messing with the session database check, so that's why you see the db query, but that didn't really change a thing.
And on another side note, is unsetting the userdata enough to log off a user? eg remove all data?

Thanks in advance,

Timo


Messages In This Thread
CI Routing to default, when function is available - by El Forum - 01-28-2012, 12:07 PM
CI Routing to default, when function is available - by El Forum - 01-28-2012, 11:08 PM
CI Routing to default, when function is available - by El Forum - 01-29-2012, 04:36 AM
CI Routing to default, when function is available - by El Forum - 01-29-2012, 07:47 AM
CI Routing to default, when function is available - by El Forum - 01-29-2012, 02:56 PM
CI Routing to default, when function is available - by El Forum - 01-29-2012, 06:09 PM
CI Routing to default, when function is available - by El Forum - 01-30-2012, 06:59 AM
CI Routing to default, when function is available - by El Forum - 02-11-2012, 12:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB