Not Logged In After Login


my website works pretty good on my computer (localhost), but since I uploaded it to a webhosting I am facing new and new problems. Most of them I have already solved, but there is one I do not know how to deal with.

Problem is, that when user tries to login, the user is not logged in. Or maybe he is, but he does not stay like that. I checked database and last_login state is set correctly, but there is probably some problem with sessions or anything else.

On my hosting provider website is written, that if my application uses HTTP authentication with usage of global variables PHP_AUTH_USER and PHP_AUTH_PW I have to make changes in my application using this manual:

Is this my cause? If so, how should I do it? When I put

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

in .htaccess, my website stops working, because I am also using friendly URLs.

It is really driving me crazy, any help will be appreciated.


Did you turn on errors? Is the sessions folder writable? What’s session.save_handler set to?

It is not returning any errors (website still runs in debug mode). But it might be problem with session folder - thanks for the tip. I will try to set a different folder and let you know.

What is your cookie domain?

Debug mode has nothing to do with whether PHP errors will be displayed, as long as you don’t do


ini_set('display_errors', 1);

it may still hide for example PHP notices.

And if session.save_handler is set to memcache, that’s probably the problem. memcache likes to randomly garbage collect sessions when memory is full, so it will login and after the redirect you’ll randomly have a new session.

hi, thanks for reply again. I tried to manualy set sessions folder and everything works perfectly now:-)