I have a situation where two cookies have the same name but several different domains (cookie1 has the domain example.com, whereas cookie2 has a subdomain inclusive of .example.com).
cookies[ :cookie_name ] = { :value => "test_value_cookie_1", :domain => "example.com" } cookies[ :cookie_name ] = { :value => "test_value_cookie_2", :domain => ".example.com" }
I want to determine if both cookies exist, but unfortunately I cannot figure out how to access the cookie using my own domain. I can say
if cookies[ :cookie_name ].blank?
but how can i say
if cookies[ :cookie_name, :domain => ".example.com" ].blank?
or
if cookies[ :cookie_name ].domain[ ".example.com" ].blank?
I use "actionpack-2.3.11 / lib / action_controller / cookies". I do not understand why you can install information such as a domain, but not gain access to it.
source share