Tayyab Shabab
Tayyab Shabab

Reputation: 259

Yii Session Not Working

Some problem is coming when I am uploading site to online server. User authentication was working on my local computer but when I am trying to upload it to a server, it is not working. When I sign in, it redirects me back to the login page.

I have checked out and come to the point that when the page refreshes, the user info from session flush away and it redirects back to login page.

$this->setState('username', $user->username);

setState method is also not giving information on next page.

Please help me out with possible solution.

Thanks

Upvotes: 1

Views: 3652

Answers (1)

ilya iz
ilya iz

Reputation: 470

Make sure that you session was started automatically in php.ini config "session.auto_start = 1" or it was started manually by session_start() or Yii similar function

$session=new CHttpSession;
  $session->open();

And check your session status by session_status() function.

Upvotes: 1

Related Questions