Hi, The answer to this is probably a one line, but i can''t find it anywhere. How do I make a cookie expire when a browser is closed (ie when the session ends)? The expiry key in the cookie hash only seems to take dates. Thanks, Scott --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> The answer to this is probably a one line, but i can''t find it > anywhere. > > How do I make a cookie expire when a browser is closed (ie when the > session ends)? The expiry key in the cookie hash only seems to take > dates.Set it to a date in the past... like 1.day.ago --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 19, 2007, at 12:32 PM, Philip Hallstrom wrote:>> The answer to this is probably a one line, but i can''t find it >> anywhere. >> >> How do I make a cookie expire when a browser is closed (ie when the >> session ends)? The expiry key in the cookie hash only seems to take >> dates. > > Set it to a date in the past... like 1.day.agoActually, if you set a cookie without giving an expiration date, it is only retained until the browser is closed. (Which can mean the program itself, not just a window or a tab.) An expiration in the past will delete the cookie immediately. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org Skype: rob.biedenharn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---