Yii Framework Forum: Not Logged In After Login - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Not Logged In After Login Rate Topic: -----

#1 User is offline   kokoseq 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 08-November 12

Posted 09 May 2013 - 03:32 PM

Hi,

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: http://www.besthostr...th-php-cgi.html

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.

Cheers!
0

#2 User is offline   Tsunami 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 16-February 12

Posted 09 May 2013 - 06:43 PM

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

#3 User is offline   kokoseq 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 08-November 12

Posted 10 May 2013 - 05:14 AM

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.
0

#4 User is offline   Jorgee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 22-March 13

Posted 10 May 2013 - 07:35 AM

What is your cookie domain?
0

#5 User is offline   Tsunami 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 16-February 12

Posted 10 May 2013 - 09:55 AM

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

error_reporting(E_ALL|E_STRICT);
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.
0

#6 User is offline   kokoseq 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 08-November 12

Posted 10 May 2013 - 03:09 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users