Issue in set cookie using ajax in rail

When I am trying to set cookies by hitting ajax from third party website to rail site then not able to set cookies is there any way to get out of it??