Example of Remember Me Function? |
[eluser]bretticus[/eluser]
Here's the basic use case: Login User fills out username and password text fields. User checks "remember me" checkbox. On successful authentication (username and password match in database)... Set a cookie using instructions from CI manual for 30 days (or whatever you feel is adequate.) The cookie must contain a user id or some other way to identify the user. In your function that checks if a user is logged in, also check for this cookie (you might want to encypt or hash something in the cookie that can validate the cookie's validity, but not required.) If the cookie is present, allow the user access (or set the session variables that indicate a user is logged in.) Have fun! |
Messages In This Thread |
Example of Remember Me Function? - by El Forum - 07-19-2010, 09:50 AM
Example of Remember Me Function? - by El Forum - 07-19-2010, 10:14 AM
Example of Remember Me Function? - by El Forum - 07-19-2010, 10:24 AM
Example of Remember Me Function? - by El Forum - 07-19-2010, 10:28 AM
Example of Remember Me Function? - by El Forum - 08-04-2010, 11:01 PM
Example of Remember Me Function? - by El Forum - 08-05-2010, 12:36 AM
|