This is the third installment of my Auth Component Tutorial. This tutorial builds on the first installment, so make sure you grab the download file:
CakePHP Auth 1 (4.3 KB, 1,619 hits)
You'll find it on almost every popular web site's login page; a nice lil' checkbox that says "Remember Me". It seems to have become a basic addition to any page with a login form. Generally, when a user logs into a web site, he's logged in until his session expires. Which usually translates to when they close the browser window or when they allow the session to timeout.
With a Remember Me cookie, you hit the lil' checkbox and it stores a lil' cookie on the user's computer. This cookie can contain various information (we'll get to that later) but it essentially enables the user to bypass the login process the next time he comes to the page requiring authentication.
So, the simplest way to proceed is to list changes by file, so strap in your seat belts, here goes.
The Obvious, The Login Form - login.ctp
Now of course you need to add the checkbox and a label for said checkbox. Simple enough:
If you're new here, you may want to subscribe to my Full RSS feed. Thanks for visiting!

Filed under: