# Google preference feature?

**URL:** <https://www.ruby-forum.com/t/google-preference-feature/106729>\
**Category:** Rails\
**Created:** [June 13, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/google-preference-feature/106729 "2007-06-13T17:28:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![green](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@green](https://www.ruby-forum.com/u/green)\
**Post date:** [June 13, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/google-preference-feature/106729/1 "2007-06-13T17:28:24Z")

</div>

I want the feature as same as google preference. it does not require  
visitors to register, just select a preference, for instance, a city,  
next time, when the same user who uses the same computer visits my  
website, he may be redirected the each city page automatically. how can  
I do it? thanks in advance.

---

<div class="post-metadata">

**Author:** ![green](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@green](https://www.ruby-forum.com/u/green)\
**Post date:** [June 13, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/google-preference-feature/106729/2 "2007-06-13T18:11:42Z")

</div>

I donÂ´t know how but I think a cookie can do that works…

2007/6/13, green [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![green](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@green](https://www.ruby-forum.com/u/green)\
**Post date:** [June 14, 2007, 5:23am UTC](https://www.ruby-forum.com/t/google-preference-feature/106729/3 "2007-06-14T05:23:11Z")

</div>

I have the same feature requirement. After checking google, I believe  
cookie may do the task.

But my question is, although I may use set cookie and get cookie to do  
something. when a user closes his browser, all the setting will be  
cleaned. so, when the user re-visit the site, he has to re-set cookie  
again.

I have no idea on how to write cookie to disk and get it back when I  
need it.

I am expecting anyone who has experiences on my problem may help me out.

thanks.

Fernando Faganello Madeira wrote:

> I donÂ´t know how but I think a cookie can do that works…
> 
> 2007/6/13, green [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
