Welcome Guest, Not a member yet? Register   Sign In
sess_expire_on_close config option questions
#6

[eluser]WanWizard[/eluser]
In a nutshell:

Look in the session class on how the session cookie is constructed. Use that code for your 'remember me' class, give the cookie a unique name, and add some identifier that links to the user in the payload (instead of the session data).
Use the expiry of the cookie to control how long the "remember me" function should be valid for.

Do not just add a cookie, anyone can create one that contains a user id. Make sure it's secure and encrypted. And CI's session library fits the bill, so re-use it.

When you load your class, check if the cookie is present (like the session class does), and if so, do an auto-login of the user. Autoload your library to make sure you have a valid user state before your controller starts.


Messages In This Thread
sess_expire_on_close config option questions - by El Forum - 05-30-2011, 02:50 AM
sess_expire_on_close config option questions - by El Forum - 05-31-2011, 04:31 PM
sess_expire_on_close config option questions - by El Forum - 06-01-2011, 02:48 AM
sess_expire_on_close config option questions - by El Forum - 06-01-2011, 08:34 AM
sess_expire_on_close config option questions - by El Forum - 06-01-2011, 09:10 AM
sess_expire_on_close config option questions - by El Forum - 06-01-2011, 01:17 PM
sess_expire_on_close config option questions - by El Forum - 06-01-2011, 03:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB