Welcome Guest, Not a member yet? Register   Sign In
Login System - Code Igniter just makes things excessively complex..
#12

[eluser]WanWizard[/eluser]
You shouldn't store the session id anywhere, as it changes regularly for security reasons.

Do it the other way around: when a user logs in, store the user_id (any maybe some other attributes) in the session. In your is_logged_in() method, check if this session variable exists, and if so, load the user from the database and return TRUE. When the user logs out, remove the user attributes from the session record and is_logged_in() will return FALSE;

Some people choose to destroy the session when the user logs out, but that's not my thing, as it deletes other session items that might have to survive a logout/login (for example a language preference).


Messages In This Thread
Login System - Code Igniter just makes things excessively complex.. - by El Forum - 08-15-2010, 04:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB