> I am looking to delete all cookies that I set when a user logs out of
> my application.
>
> def logout
> for cook in cookies
> cookies.delete cook[0]
> end
> redirect_to ''/''
> end
>
> does not seem to be doing the trick. Even though it looks right in my
> log file the cookies don''t actually expire. Any ideas?
This works for me...
cookies.to_hash.each_pair do |k, v|
cookies[k.to_sym] = { :value => '''',
:path => ''/'',
:domain => ''.domain.com'',
:expire => 1.day.ago }
end
redirect_to ''/''
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---