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

[eluser]xuma[/eluser]
[quote author="haseydesign" date="1355910819"]@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[/quote]

Thanks for your long answer

After spending hours , searching for answer , about 1 hour ago i setup new codeigniter/flexi_auth with same database.Demo was working fine.

After i include demo files to my main project , main project with demo files wasnt working again.Finally i changed config file and it was starting to work.There was only one difference;

Code:
$config['language'] = 'english';

My main project was using ;
Code:
$config['language'] = 'turkish';

How the hell that can be problem ? Smile I spend atleast 5-6 hours chasing set_userdata function in core files.

I had same language files in both english and turkish folders.I dont know how this effects but it was really annoying.


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



Theme © iAndrew 2016 - Forum software by © MyBB