Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[eluser]haseydesign[/eluser]
@xuma

From your comment, I'm not 100% sure what the exact problem you are having is; however, some notes...

Firstly, both the flexi auth and flexi cart libraries require that the 'sess_use_database' MUST be set to TRUE as the session array for all the authentication and cart data is too big to store in a cookie, therefore its stored in the database instead.

Then from what I can understand of your problem, you are stating that the 'login()' function is working (Returning TRUE at least), but the 'is_logged_in()' function is returning FALSE. Am I right?

If you are calling the 'is_logged_in()' function immediately after calling the 'login()' function, then the 'is_logged_in()' function will return FALSE regardless of whether you are logged in as it is session dependent, and in CI when using sessions, changes do not become readable until after page reload. Therefore you need to do a page reload (You can use CI's 'redirect()' function) and then call the 'is_logged_in()' function to check a users status.

As a side note, typically you shouldn't need to check if a user is logged in immediately after calling the 'login()' function. If it returns TRUE, then they're logged in; there is no need to revalidate until after page load.

This reason why you say it works when you switch 'sess_use_database' to FALSE, is that maybe CI can read/return session data that has has been set within the same page load.

Hope that helps.
Rob


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 12-19-2012, 02:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB