# "Remember Me" feature

**URL:** <https://www.ruby-forum.com/t/remember-me-feature/151932>\
**Category:** Rails\
**Created:** [October 28, 2008, 2:49am UTC](https://www.ruby-forum.com/t/remember-me-feature/151932 "2008-10-28T02:49:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thabenksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Post date:** [October 28, 2008, 2:49am UTC](https://www.ruby-forum.com/t/remember-me-feature/151932/1 "2008-10-28T02:49:15Z")

</div>

Posted by Ben K. (biguniverse) on 28.10.2008 02:28  
I realize this has probably been asked on these forums before but I  
wanted to get the latest information on what’s available.

We need to implement the typical “Remember Me” checkbox feature you find  
for logins on various site.

What’s the best way to do this in Rails 1.2.x and 2.x? Should we use  
cookies[] directly? Or, can I use session[]? We need this “remember  
me” to be around for at least 2 weeks, maybe even forever (till they  
logout).

Thanks.

---

<div class="post-metadata">

**Author:** ![thabenksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Post date:** [October 28, 2008, 8:24am UTC](https://www.ruby-forum.com/t/remember-me-feature/151932/2 "2008-10-28T08:24:47Z")

</div>

Hi Ben,

I’m afraid you need to use cookies. But it’s not that hard, really ;),  
and is flexible enough. Please note you might not want to store any  
sensitive information in cookie also, like username etc. in cleartext

- maybe setting up special purpose hash in user model, and storing it  
also in cookie is good idea. You need also not to forget about  
situation where user can use “remember me” on multiple computers -  
otherwise your users will complain.

H.

---

<div class="post-metadata">

**Author:** ![thabenksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Post date:** [October 28, 2008, 10:10am UTC](https://www.ruby-forum.com/t/remember-me-feature/151932/3 "2008-10-28T10:10:48Z")

</div>

May I reccomend  
[http://www.thewojogroup.com/2008/09/remember-mes-with-rails/](http://www.thewojogroup.com/2008/09/remember-mes-with-rails/)

---

<div class="post-metadata">

**Author:** ![thabenksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Post date:** [October 28, 2008, 1:17pm UTC](https://www.ruby-forum.com/t/remember-me-feature/151932/4 "2008-10-28T13:17:49Z")

</div>

I always use Restful\_Authentication ([technoweenie · GitHub](http://github.com/technoweenie/)  
restful-authentication). Even if you don’t want to use that, I suggest  
you take a look at how it handles it.

HTH

---

<div class="post-metadata">

**Author:** ![thabenksta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/97f17d/32.png) [@thabenksta](https://www.ruby-forum.com/u/thabenksta)\
**Post date:** [October 29, 2008, 7:25pm UTC](https://www.ruby-forum.com/t/remember-me-feature/151932/5 "2008-10-29T19:25:14Z")

</div>

Thanks everyone.
