> @@ -24,6 +24,21 @@ def to_a
>      end
>  
>      #
> +    # Returns a cookie by name.
> +    #
> +    # @example
> +    #   browser.cookies[:my_session]
> +    #   #=> {:name=>"my_session", :value=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk", 
> :domain=>"mysite.com"}
> +    #
> +    # @param [Symbol] name
> +    # @return <Hash> or nil if not found
> +    #
> +
> +    def [](name)
> +      @control.all_cookies.select { |c| c[:name] == name.to_s }.first

Shouldn't you use `Cookies#to_a` instead of `@control.all_cookies` to get the 
`expires` formatted correctly?

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/pull/249/files#r10569895
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to