Website is unable to properly retrieve session inf

2019-07-20 21:30发布

I had some very simple code on a website to handle logins on the root of the site using ion_auth:

if(!$this->ion_auth->logged_in())
{
   redirect("/login");
}

That page posts to /auth/login, which is handled by ion_auth. If the login is successful, the user is redirected to the root of the site. Otherwise, they go back to /login to try again. I initially thought I'd forgotten the password, but with a series of var_dump() calls, I found that the login is successful, but the call to $this->ion_auth->logged_in() returns false anyway.

All of this is after the host upgraded to PHP 7 - the code worked before. I've tried upgrading ion_auth, but it didn't help.

1条回答
够拽才男人
2楼-- · 2019-07-20 22:04

There were session related problems in early CI 3.x version, documented here and here

several session related issues were resolved in the latest versions, see the change logs

solution: update to CI 3.1.7. (latest version as writing)

Upgrading From a Previous Version

查看更多
登录 后发表回答