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

[eluser]besson3c[/eluser]
[quote author="WanWizard" date="1306973848"]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.[/quote]


Yeah, as I've been researching this I've been thinking that it might be cool to create a CodeIgniter spark out of a library that would create entries in a "ci_cookies" table and do just as you've described here. Another part of this library would be disabling access to accounts (that may have a valid cookie set). If I decide to go ahead with this work I'll update this thread with my progress...


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