views:

120

answers:

1

My Kohana app runs perfectly on my local machine.

When I deployed my app to a server (and adjust the config files appropriately), I can no longer log into the app.

I've traced through the app login routine on both my local version and the server version and they both agree with each other all the way through until you get to the auth.php controller logged_in() routine where suddenly, at line 140 - the is_object($this->user) test - the $user object no longer exists!?!?!?

The login() function call that calls the logged_in() function successfully passes the following test, which causes a redirect to the logged_in() function.

if(Auth::instance()->login($user, $post['password'])) 

Yes, the password and hash, etc all work perfectly.

Here is the offending code:

public function logged_in()
{
    if ( ! is_object($this->user))
    {
    // No user is currently logged in
    url::redirect('auth/login'); 
    }
etc...
}

As the code is the same between my local installation and the server, I reckon it must be some server setting that is messing with me.

FYI: All the rest of the code works because I have a temporary backdoor available that allows me to use the application (view pages of tables, etc) without being logged in.

Any ideas?

A: 

I solved the problem (DUH!).

The answer was that the cookie.php config file had $config['domain'] = 'localhost'. Setting this to the actual domain that the app is installed in magically made my life happy again!

Thanks everyone for your help and interest.

Steve